SPFolder.Delete Method
Deletes the folder.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
<ClientCallableMethodAttribute(Name := "DeleteObject", RemoveThisObjectFromParentCollection := True)> _
<ClientCallableExceptionConstraintAttribute(FixedId := "1", Condition := "Lack of permissions to perform the operation.", _
ErrorType := GetType(UnauthorizedAccessException))> _
Public Sub Delete
'Usage
Dim instance As SPFolder
instance.Delete()
[ClientCallableMethodAttribute(Name = "DeleteObject", RemoveThisObjectFromParentCollection = true)]
[ClientCallableExceptionConstraintAttribute(FixedId = "1", Condition = "Lack of permissions to perform the operation.",
ErrorType = typeof(UnauthorizedAccessException))]
public void Delete()
Remarks
This method deletes the folder, and sets the status of folder collection to which it belongs as modified.