Word) (Document.CommandBars 屬性

會傳回代表功能表列和 Microsoft Word 中的所有工具列的 CommandBars 集合。

語法

運算式CommandBars

需要 expression。 代表 Document 物件的變數。

註解

請使用 CustomizationContext 屬性設定範本或文件的內容存取 CommandBars 集合之前。

如需傳回集合中單一成員的資訊,請參閱 從集合傳回物件

範例

此範例會放大所有命令列按鈕,並啟用工具提示。

With CommandBars 
 .LargeButtons = True 
 .DisplayTooltips = True 
End With

此範例會在應用程式視窗的底端顯示 [繪圖] 工具列。

With CommandBars("Drawing") 
 .Visible = True 
 .Position = msoBarBottom 
End With

This example adds the Versions command button to the Standard toolbar.

CustomizationContext = NormalTemplate 
CommandBars("Standard").Controls.Add Type:=msoControlButton, _ 
 ID:=2522, Before:=4

另請參閱

Document 物件

支援和意見反應

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