Microsoft Office Tutorials and References
In Depth Information
Table 17-5. Key Properties and Methods of the CommandBarControl
Property: contains programmer-defined information. This property
can be used with the CommandBar.FindControl method to help
locate a particular control.
Property: contains text that will be displayed if the user hovers the
mouse pointer over the control. By default, the value from the
Caption property will be displayed.
Property: contains the distance between the top edge of the
command bar control and the top edge of the screen.
Property (read-only): indicates type of the command bar control.
Property: True when the CommandBarControl is displayed on the
screen. Remember that the Enabled property must be True before
you can set this property to True .
Property: contains the width of the command bar control in pixels.
When the user clicks or selects a command bar control, the subroutine specified in the
OnAction property is fired. You also have the option to execute the routine associated with
the command bar control by using the Execute method.
The Parameter and Ta g properties are simply areas in which you can store additional infor
mation about the specific instance of the control. The Ta g property can be useful if you want
to locate a specific control based on its Ta g value with the FindControl method. You could
create a common OnAction routine that performs various actions based on the specific value
in the Parameter property for each control.
The Copy and Move methods allow you to relocate controls from one command bar to
another, and the Delete method will remove the control from the command bar and the
There is only one specific type of button control, which is msoControlButton . This object is
useful in situations where you wish to execute a subroutine in response to the user pressing a
button or selecting a menu item. Table 17-6 lists the unique properties and methods for the
CommandBarButton object when compared with the base CommandBarControl object.