Compartilhar via


Field.ShowCodes Property

Word Developer Reference

True if field codes are displayed for the specified field instead of field results. Read/write Boolean.

Syntax

expression.ShowCodes

expression   An expression that returns a Field object.

Example

This example selects the next field and displays the field codes.

Visual Basic for Applications
  With Selection
    .GoTo What:=wdGoToField
    .Expand Unit:=wdWord
    If .Fields.Count = 1 Then .Fields(1).ShowCodes = True
End With

This example updates and displays the result of the first field in the active document.

Visual Basic for Applications
  If ActiveDocument.Fields.Count >= 1 Then
    With ActiveDocument.Fields(1)
        .Update
        .ShowCodes = False
    End With
End If

See Also