Export (0) Print
Expand All
Expand Minimize

Document.CommandBars Property

Gets a CommandBars collection that represents the menu bar and all the toolbars in Microsoft Office Word.

Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word (in microsoft.office.tools.word.dll)

public virtual CommandBars CommandBars { get; }

Property Value

A CommandBars collection that represents the menu bar and all the toolbars in Microsoft Office Word.

Use the CustomizationContext property to set the template or document context prior to accessing the CommandBars collection.

The following code example makes the Drawing toolbar visible at the bottom of the application.

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

Show:
© 2015 Microsoft