Share via


DocumentBase.CommandBars 屬性

取得 CommandBars 集合,表示 Microsoft Office Word 中的功能表列和所有工具列。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

語法

'宣告
Public ReadOnly Property CommandBars As CommandBars
public CommandBars CommandBars { get; }

屬性值

型別:Microsoft.Office.Core.CommandBars
CommandBars 集合,表示 Microsoft Office Word 中的功能表列和所有工具列。

備註

使用 CustomizationContext 屬性設定範本或文件內容,然後再存取 CommandBars 集合。

範例

下列程式碼範例會讓 [繪圖] 工具列顯示在應用程式底部。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

Private Sub DocumentCommandBars()
    Me.CommandBars("Drawing").Visible = True
    Me.CommandBars("Drawing").Position = Office.MsoBarPosition.msoBarBottom
End Sub
private void DocumentCommandBars()
{
    this.CommandBars["Drawing"].Visible = true;
    this.CommandBars["Drawing"].Position = Office.MsoBarPosition.msoBarBottom;
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間