Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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