Field.Locked Property

Word Developer Reference

True if the specified field is locked. Read/write Boolean.

Syntax

expression.Locked

expression   Required. A variable that represents a Field object.

Remarks

When a field is locked, you cannot update the field results.

Example

This example inserts a DATE field at the beginning of the selection and then locks the field.

Visual Basic for Applications
  Selection.Collapse Direction:=wdCollapseStart
Set myField = ActiveDocument.Fields.Add(Range:=Selection.Range, _
    Type:=wdFieldDate)
myField.Locked = True

See Also