MoveTo Method

The MoveTo method of the SPFolder class moves the folder and its contents to a new folder at the specified URL.

Parameters

strNewUrl   A string that specifies the URL for the new folder.

Remarks

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.

Example

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.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security