Word) (Application.CommandBars 屬性

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

重要事項

此屬性已經變更。 CommandBars (「批註」) 無法用來自訂批註的操作功能表。

語法

運算式CommandBars

expression 代表 Application 物件的變數。

註解

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

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

範例

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

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

This example displays the Drawing toolbar at the bottom of the application window.

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

另請參閱

Application 物件

支援和意見反應

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