Share via


Fields.Locked Property (Word)

True if all fields in the Fields collection are locked. Read/write Long.

Syntax

expression .Locked

expression Required. A variable that represents a Fields collection.

Remarks

This property can be True, False, or wdUndefined (if some of the fields in the collection are locked and others are not).

Example

This example locks all the fields in the selection.

Selection.Fields.Locked = True

This example displays a message if some of the fields in the active document are locked.

Set theFields = ActiveDocument.Fields 
If theFields.Locked = wdUndefined Then 
 MsgBox "Some fields are locked" 
ElseIf theFields.Locked = False Then 
 MsgBox "No fields are locked" 
ElseIf theFields.Locked = True Then 
 MsgBox "All fields are locked" 
End If

See Also

Concepts

Fields Object Members

Fields Collection Object