Compartilhar via


Fields.Locked Property

Word Developer Reference

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.

Visual Basic for Applications
  Selection.Fields.Locked = True

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

Visual Basic for Applications
  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