Share via


Term.Copy Method

Creates and returns a sibling copy of the current Term object within the current TermSet object.

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

Syntax

'Declaration
Public Function Copy ( _
    doCopyChildren As Boolean _
) As Term
'Usage
Dim instance As Term
Dim doCopyChildren As Boolean
Dim returnValue As Term

returnValue = instance.Copy(doCopyChildren)
public Term Copy(
    bool doCopyChildren
)

Parameters

  • doCopyChildren
    Type: System.Boolean

    Indicates whether to copy this Term with its child terms.

Return Value

Type: Microsoft.SharePoint.Taxonomy.Term
The newly created copied Term

Exceptions

Exception Condition
UnauthorizedAccessException

The current user has insufficient permissions to perform this operation.

TermStoreOperationException

This operation is invalid in the orphaned terms TermSet. The operation failed.

Remarks

The copied Term will have the same properties as the current Term, except for the Name property. If the term is copied with its child terms, the newly created child terms will have the same properties as the child terms of the current term including the Name property.The copied child terms will perserve the same hierarchy.

The current user must have TaxonomyRights.EditTerm permission in order to use this method. Call the CommitAll() method to save this change to the database.

See Also

Reference

Term Class

Term Members

Microsoft.SharePoint.Taxonomy Namespace