SPListItem.Copy Method (String, String)
Copies the specified version of the item to the specified destination.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Shared Sub Copy ( _
sourceUrl As String, _
destinationUrl As String _
)
'Usage
Dim sourceUrl As String
Dim destinationUrl As StringSPListItem.Copy(sourceUrl, destinationUrl)
public static void Copy(
string sourceUrl,
string destinationUrl
)
Parameters
sourceUrl
Type: System.StringThe source URL of the item to copy.
destinationUrl
Type: System.StringThe destination URL of the item.
Note
The destination URL must reside on the same server on which the code is running. This copy operation does not copy to URLs on remote servers.
Exceptions
Exception | Condition |
---|---|
ArgumentException | sourceUrl or destinationUrl is null or empty. |
Remarks
This method copies the list item specified by the sourceUrl parameter to the destination location specified by the destinationUrl parameter.