CommandBar Interface

Represents a command bar in the container application.

Namespace:  Microsoft.Office.Core
Assembly:  office (in office.dll)

Syntax

'Declaration
<GuidAttribute("000C0304-0000-0000-C000-000000000046")> _
Public Interface CommandBar _
    Inherits _IMsoOleAccDispObj
'Usage
Dim instance As CommandBar
[GuidAttribute("000C0304-0000-0000-C000-000000000046")]
public interface CommandBar : _IMsoOleAccDispObj

Remarks

The CommandBar object is a member of the _CommandBars collection.

Use CommandBars(index), where index is the name or index number of a command bar, to return a single CommandBar object.

You can use a name or index number to specify a menu bar or toolbar in the list of available menu bars and toolbars in the container application. However, you must use a name to specify a menu, shortcut menu, or submenu (all of which are represented by CommandBar objects).

If two or more custom menus or submenus have the same name, CommandBars(index) returns the first one. To ensure that you return the correct menu or submenu, locate the pop-up control that displays that menu. Then apply the CommandBar property to the pop-up control to return the command bar that represents that menu.

See Also

Reference

CommandBar Members

Microsoft.Office.Core Namespace