Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CoAuthLock Object (Word)

Represents a lock within the document. The CoAuthLock object is a member of the CoAuthLocks collection.

Version Added: Word 2010

Use Locks(index), where index is the index number, to return a CoAuthLock object. When adding a CoAuthLock object, use the WdLockType enumeration to specify the type of lock.

The following code example returns the first lock in the active document.

Dim myLock as CoAuthLock 
 
Set myLock = ActiveDocument.CoAuthoring.Locks(1)

The following code example adds a reservation lock on the third paragraph in the active document. Reservation locks are explicitly created by a document author and are persisted across explicit save actions (locks of type wdLockEphemeral do not persist across explicit saves). You can add locks with a with a lock type of wdLockReservation using the Word 2010 ribbon. For example, you can create a reservation lock on a selected paragraph range using Block Authors on the Review tab.

ActiveDocument.CoAuthoring.Locks.Add(ActiveDocument.Paragraphs(3), wdLockReservation)
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.