Export (0) Print
Expand All

SPFolder.MoveTo method

Moves the folder and its contents to a new folder at the specified URL.

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

Public Sub MoveTo ( _
	strNewUrl As String _
Dim instance As SPFolder
Dim strNewUrl As String



Type: System.String

A string that specifies the URL for the new folder.

The MoveTo method applies only to the context of a single site.

The following code example moves a specified subfolder in the site from one folder into another folder.

Dim site As SPWeb = SPControl.GetContextWeb(Context)

If site.GetFolder("Shared Documents/Source_Subfolder_Name").Exists Then

    Dim moveFolder As SPFolder = web.GetFolder
        ("Shared Documents/Source_Subfolder_Name")


End If
© 2014 Microsoft