Page 393 - Microsoft Office Excel 2003 Programming Inside Out
P. 393
Part 5: Manipulating Excel Objects
Command Bars
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
specified criteria.
CommandBar Objects
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
Object
Property/Method Description
AdaptiveMenus Property: when True, means that adaptive menus will be
used with this command bar.
BuiltIn Property (read-only): returns True if the command bar is a
part of Excel.
Controls Property (read-only): returns an object reference to a
CommandBarControls collection containing all the controls
on the command bar.
Delete Method: removes this command bar from the CommandBars
collection.
Enabled 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
Visible, Recursive) 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.
Tag searches for matches using the control’s Tag property.
Visible, when True, limits the search to only those controls Chapter 17
that are visible. Recursive, when True, searches through the
current CommandBar object and all of its pop-up sub
toolbars.
Height Property: contains the height of the command bar in pixels.
Index Property (read-only): returns the relative position of the
command bar in the CommandBars collection.
continued
367