ShowCodes 属性

       

如果为 True,则显示指定域的域代码而不是域结果。Boolean 类型,可读写。

expression.ShowCodes

expression   必需。此表达式返回一个 Field 对象。

示例

本示例选定下一个域,并显示其域代码。

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

本示例更新并显示活动文档中第一个域的结果。

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