SetDefaultTableStyle 方法

       

指定用于文档中新创建的表格的表格样式。

expression.SetDefaultTableStyle(Style, SetInTemplate)

expression   必需。该表达式返回一个 Document 对象。

Style  Variant 类型,必需。指定样式名称的字符串。

SetInTemplate  Boolean 类型,必需。如果为 True,则在文档附加的模板中保存表格样式。

示例

本示例检查活动文档中使用的默认表格样式是否是 Table Normal,如果是,将默认表格样式改为 TableStyle1。本示例假定存在名为 TableStyle1 的表格样式。

Sub TableDefaultStyle()

    With ActiveDocument

        If .DefaultTableStyle = "Table Normal" Then
            .SetDefaultTableStyle _
                Style:="TableStyle1", SetInTemplate:=True
        End If

    End With

End Sub