Word) (Document.SetDefaultTableStyle 方法

指定要針對文件中新建立之表格使用的表格樣式。

語法

expressionSetDefaultTableStyle( _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

另請參閱

Document 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應