Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The MoveTo method of the SPFolder class moves the folder and its contents to a new folder at the specified URL.
strNewUrl A string that specifies the URL for the new folder.
The MoveTo method only applies to the context of a single site.
This method raises an error if a folder of the same name as the one specified in the strNewUrl parameter already exists.
The following code example moves a specified subfolder in the site from one folder into another folder.
This example requires using directives (Imports in Visual Basic) for both the Microsoft.SharePoint and Microsoft.SharePoint.WebControls namespaces.
Platforms: Microsoft Windows Server 2003
Security: Code Access Security
Please sign in to use this experience.
Sign in