This documentation is archived and is not being maintained.

Document.CommandBars Property (2007 System)

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.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

[BrowsableAttribute(false)]
public CommandBars CommandBars { get; }

Property Value

Type: CommandBars
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.

This example is for a document-level customization.

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

Show: