CommandBarControl Object
Office Developer Reference |
Represents a command bar control. The CommandBarControl object is a member of the CommandBarControls collection. The properties and methods of the CommandBarControl object are all shared by the CommandBarButton, CommandBarComboBox, and CommandBarPopup objects.
Note |
---|
The use of CommandBars in some Microsoft Office applications has been superseded by the new Ribbon user interface. For more information, search help for the keyword "Ribbon." |
Remarks
When writing Visual Basic code to work with custom command bar controls, you use the CommandBarButton, CommandBarComboBox, and CommandBarPopup objects. When writing code to work with built-in controls in the container application that cannot be represented by one of those three objects, you use the CommandBarControl object. Use Controls(
index
), where
index
is the index number of a control, to return a CommandBarControl object. (The Type property of the control must be msoControlLabel, msoControlExpandingGrid, msoControlSplitExpandingGrid, msoControlGrid, or msoControlGauge). Variables declared as CommandBarControl can be assigned CommandBarButton, CommandBarComboBox, and CommandBarPopup values.
Example
You can also use the FindControl method to return a CommandBarControl object. The following example searches for a control of type msoControlGauge; if it finds one, it displays the index number of the control and the name of the command bar that contains it. In this example, the variable
lbl
represents a CommandBarControl object.
Visual Basic for Applications |
---|
|
See Also
- Object Model Reference
- CommandBarControl Object Members
- How to: Add a New Navigation Group and Move a Folder into that Group
- How to: Customize a Context Menu to Support Moving Items between Calendars
- How to: Customize an Item Context Menu
- How to: Enumerate, Show, Hide, and Position Modules in the Navigation Pane
- How to: Hide or Disable a Menu Item on a Context Menu
- How to: Share Contact Information Including the Business Card