Microsoft Office Tutorials and References
In Depth Information
The Add method creates an empty command bar object with the specified properties, and the
FindControl method searches through all the command bars looking for a control with the
CommandBar objects represent containers in which the individual menu items or icons can
be placed. A CommandBar object is referenced through the CommandBars collection. This
collection exists for the Application object, as well as other CommandBarControls that can
contain other controls, such as a menu control having a submenu. Table 17-2 lists the key
properties and methods for the CommandBar object.
Table 17-2. Key Properties and Methods of the CommandBar
Property: when True , means that adaptive menus will be
used with this command bar.
Property (read-only): returns True if the command bar is a
part of Excel.
Property (read-only): returns an object reference to a
CommandBarControls collection containing all the controls
on the command bar.
Method: removes this command bar from the CommandBars
Property: when True , means that the CommandBar object will
be displayed in the list of available command bars.
FindControl(Type, Id, Tag,
Method: returns an object reference to the
CommandBarControl object that matches the specified
criteria. Type specifies the type of control using the
MsoControlType enumeration. (See Table 17-4 for a complete
list of the enumeration.) Id specifies the name of the control.
Ta g searches for matches using the control’s Tag property.
Visible , when True , limits the search to only those controls
that are visible. Recursive , when True , searches through the
current CommandBar object and all of its pop-up sub
Property: contains the height of the command bar in pixels.
Property (read-only): returns the relative position of the
command bar in the CommandBars collection.