Share via


_CommandBars Interface 

A collection of CommandBar objects that represent the command bars in the container application.

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

Usage

Public Class commandBarsImplementation
    Implements _CommandBars
End Class
Dim commandBarsImplementation1 As New commandBarsImplementation()

Syntax

Public Interface _CommandBars
    Inherits _IMsoDispObj, IEnumerable
public interface _CommandBars : _IMsoDispObj, IEnumerable
public interface class _CommandBars : public _IMsoDispObj, IEnumerable
public interface _CommandBars implements _IMsoDispObj, IEnumerable
public interface _CommandBars implements _IMsoDispObj, , IEnumerable

Remarks

Use the CommandBars property to return the CommandBars collection.

Use the Add method to add a new command bar to the collection.

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

Note

You can use the 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 the 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.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

Microsoft.Office.Core Namespace

Other Resources

_CommandBars Members