Command BarControl Object and the Command BarControls Collection Object

The CommandBarControl object represents a generic control on a CommandBar. A control usually consists of a CommandBarButton, a CommandBarComboBox, or a CommandBarPopup. When using one of these controls, you can work with them directly using their own object reference. Doing so will yield all of the properties and methods specific to that control.

Use the Control object when you are unsure which type of CommandBar object you are working with, or when using controls other than the three mentioned earlier. Most of the methods and properties for the CommandBarControl object can also be accessed via the CommandBarButton, CommandBarComboBox, and CommandBarPopup controls.

The CommandBarControl collection object holds all of the controls on a CommandBar. This collection's name can only be seen when declaring it as a variable type. You can access all the controls for a CommandBar directly, using:


Where Index can either be a number representing its position on the list of CommandBars or a string representing the Name of the CommandBar.

0 0

Post a comment