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
site
Type: Microsoft.SharePoint.SPSitetrue if it enables assigning DocumentId objects; otherwise, false.
fEnable
Type: System.BooleanSite on which to enable or disable the ability to assign DocumentID objects.
fScheduleAssignment
Type: System.Booleantrue if overwriting existing DocumentId objects is permitted; otherwise, false
fOverwriteExistingIds
Type: System.Booleantrue 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.