CoAuthLocks.Add (Word)

Returns a CoAuthLock object that represents a lock added to a specified range.

The following code example adds a reservation lock to the first paragraph in the active document.

Syntax : expression.Add (Range, Type)

ActiveDocument.CoAuthoring.Locks.Add(ActiveDocument.Paragraphs(1).Range, wdLockReservation)


The following arguments are optional

Range (Range) - Specifies the document range locked by the CoAuthLock object. This parameter may be a Paragraph, Column, Cell, Row, Table, Range, or Selection object.

Type (WdLockType) - Specifies the type of lock. The WdLockType specified can only be wdLockEphemeral or WdLockReservation.

Possible Values are

wdLockChanged Specifies a placeholder lock. A placeholder lock indicates that another user has removed their lock from the range, but the current user has not updated their view of the document by saving.
wdLockEphemeral Specifies an ephemeral lock. Word implicitly places an ephemeral lock on a range when a user begins editing a range in a document with coauthoring enabled.
wdLockNone Reserved for future use.
wdLockReservation Specifies a reservation lock. A reservation lock is explicitly created by a user through the Block Authors button on the Review tab in Word.