DocumentBase.CommandBars 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个 CommandBars 集合,该集合表示 Microsoft Office Word 中的菜单栏和所有工具栏。
public Microsoft.Office.Core.CommandBars CommandBars { get; }
属性值
一个 CommandBars 集合,表示 Microsoft Office Word 中的菜单栏和所有工具栏。
示例
下面的代码示例使绘图工具栏在应用程序的底部可见。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。
private void DocumentCommandBars()
{
this.CommandBars["Drawing"].Visible = true;
this.CommandBars["Drawing"].Position = Office.MsoBarPosition.msoBarBottom;
}
Private Sub DocumentCommandBars()
Me.CommandBars("Drawing").Visible = True
Me.CommandBars("Drawing").Position = Office.MsoBarPosition.msoBarBottom
End Sub
注解
在 CustomizationContext 访问集合之前,请使用属性设置模板或文档上下文 CommandBars 。