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)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property CommandBars As CommandBars
'Usage
Dim instance As Document 
Dim value As CommandBars 

value = instance.CommandBars
[BrowsableAttribute(false)]
public CommandBars CommandBars { get; }
[BrowsableAttribute(false)]
public:
property CommandBars^ CommandBars {
    CommandBars^ get ();
}
public function get CommandBars () : CommandBars

Property Value

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

Remarks

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

Examples

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

This example is for a document-level customization.

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 Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace