BuiltIn 属性

       

如果该属性值为 True,则指定对象是 Word 的内置样式或题注标签之一。Boolean 类型,只读。

说明

可用 WdBuiltinStyle 常量指定所有语言通用的内置样式,也可用 Word 的某个语言版本的样式名来指定某种语言使用的内置样式。例如,如果在 Microsoft Office 的语言设置中指定美式英语,则下列语句是等效的:

ActiveDocument.Styles(wdStyleHeading1)
ActiveDocument.Styles("Heading 1")

示例

本示例实现的功能是:检查活动文档中的所有样式,如果检查到一个非内置样式,则显示该样式的名称。

Dim styleLoop As Style

For Each styleLoop in ActiveDocument.Styles
    If styleLoop.BuiltIn = False Then
        Msgbox styleLoop.NameLocal
    End If
Next styleLoop

本示例实现的功能是:检查应用程序中创建的所有题注标签,如果检查到一个非内置的题注标签,则显示该标签的名称。

Dim clLoop As CaptionLabel

For Each clLoop in CaptionLabels
    If clLoop.BuiltIn = False Then
        Msgbox clLoop.Name
    End If
Next clLoop