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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.