다음을 통해 공유


DocumentId.EnableAssignment Method (SPSite, Boolean, Boolean, Boolean)

Enables or disables DocumentId objects assigned on a SPSite site.

Namespace:  Microsoft.Office.DocumentManagement
Assembly:  Microsoft.Office.DocumentManagement (in Microsoft.Office.DocumentManagement.dll)

Syntax

'Declaration
Public Shared Sub EnableAssignment ( _
    site As SPSite, _
    fEnable As Boolean, _
    fScheduleAssignment As Boolean, _
    fOverwriteExistingIds As Boolean _
)
'Usage
Dim site As SPSite
Dim fEnable As Boolean
Dim fScheduleAssignment As Boolean
Dim fOverwriteExistingIds As BooleanDocumentId.EnableAssignment(site, fEnable, _
    fScheduleAssignment, fOverwriteExistingIds)
public static void EnableAssignment(
    SPSite site,
    bool fEnable,
    bool fScheduleAssignment,
    bool fOverwriteExistingIds
)

Parameters

  • fEnable
    Type: System.Boolean

    Site on which to enable or disable the ability to assign DocumentID objects.

  • fScheduleAssignment
    Type: System.Boolean

    true if overwriting existing DocumentId objects is permitted; otherwise, false

  • fOverwriteExistingIds
    Type: System.Boolean

    true if it schedules the timer job; otherwise, false

Exceptions

Exception Condition
ArgumentException

The SPSite object value or the properties of its root SPWeb object are set to a null reference (Nothing in Visual Basic).

InvalidOperationException

The Document ID feature is not activated on the target SPSite object.

Remarks

Always applies to all content types, never sets a prefix for ids and allows control over scheduling and overwriting.

See Also

Reference

DocumentId Class

DocumentId Members

EnableAssignment Overload

Microsoft.Office.DocumentManagement Namespace

IsAssignmentEnabled(SPSite)