CommandBars 属性

       

该属性返回一个 CommandBars 集合,该集合代表 Microsoft Word 中的菜单栏和所有的工具栏。

expression.CommandBars

expression   必需。该表达式返回“应用于”列表中的一个对象。

说明

在访问 CommandBars 集合之前,可用 CustomizationContext 属性设置模板或文档上下文。

有关返回集合中单独成员的内容,请参阅返回集合中的对象

示例

本示例增大所有的命令栏按钮并激活工具提示。

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

本示例在应用程序窗口底部显示“绘图”工具栏。

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

本示例将“版本”命令按钮添至“常用”工具栏。

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