Share via


SPListItem.CopyFrom method (String)

Overwrites the current item with the specified version of the item.

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

Syntax

'Declaration
Public Sub CopyFrom ( _
    sourceUrl As String _
)
'Usage
Dim instance As SPListItem
Dim sourceUrl As String

instance.CopyFrom(sourceUrl)
public void CopyFrom(
    string sourceUrl
)

Parameters

  • sourceUrl
    Type: System.String

    The URL of the specified version of the item to copy and overwrite the current item.

    Note

    The source URL must reside on the same server on which the code is running. This copy operation does not copy from URLs on remote servers.

Exceptions

Exception Condition
ArgumentException

sourceUrl is null or empty.

NotSupportedException

The SPListItem object has an external data source.

Remarks

The CopyFrom method resets the CopySource property on the destination item to the value of the sourceUrl parameter.

See also

Reference

SPListItem class

SPListItem members

CopyFrom overload

Microsoft.SharePoint namespace