DocumentBase.CommandBars 属性

定义

获取一个 CommandBars 集合,该集合表示 Microsoft Office Word 中的菜单栏和所有工具栏。

public Microsoft.Office.Core.CommandBars CommandBars { get; }

属性值

CommandBars

一个 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

适用于