CoAuthLocks.Add method (Word)
Returns a CoAuthLock object that represents a lock added to a specified range.
Syntax
expression.Add (Range, Type)
expression An expression that returns a 'CoAuthLocks' object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Range | Optional | Variant | Specifies the document range locked by the CoAuthLock object. This parameter may be a Paragraph, Column, Cell, Row, Table, Range, or Selection object. |
Type | Optional | WdLockType | Specifies the type of lock. The WdLockType specified can only be wdLockEphemeral or WdLockReservation |
Return value
CoAuthLock
Remarks
The following code example adds a reservation lock to the first paragraph in the active document.
Note
By default, if no arguments are given in the call to the CoAuthLocks.Add method, a reservation lock is placed on the paragraph that contains the insertion point.
Example
ActiveDocument.CoAuthoring.Locks.Add(ActiveDocument.Paragraphs(1).Range, wdLockReservation)
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for