SPAttachmentCollection.Delete method

Deletes the attachment with the specified file name from the collection.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

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

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

Parameters

  • leafName
    Type: System.String

    The file name of the attachment to delete.

Exceptions

Exception Condition
ArgumentOutOfRangeException

The leafName does not exist in the collection.

Remarks

The process of deleting an attachment with this method requires that the list item be updated to refresh version information.

See also

Reference

SPAttachmentCollection class

SPAttachmentCollection members

Microsoft.SharePoint namespace