Share via


SPAttachmentCollection.RecycleNow Method

Recycles the attachment that is represented by the specified file name without requiring an update to the parent list item.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Sub RecycleNow ( _
    leafName As String _
)
'Usage
Dim instance As SPAttachmentCollection
Dim leafName As String

instance.RecycleNow(leafName)
public void RecycleNow(
    string leafName
)

Parameters

Exceptions

Exception Condition
ArgumentOutOfRangeException

leafName does not exist in the collection.

Remarks

If you recycle an attachment by using the RecycleNow method, the action takes effect immediately and you do not need to call the Update method to update the list item and refresh version information.

See Also

Reference

SPAttachmentCollection Class

SPAttachmentCollection Members

Microsoft.SharePoint Namespace