Provides access to members that define a command item.
Product Availability
When To Use
A CommandItem is any item on a commandbar. For example, buttons, tools, and menu items that appear on commandbars are all commanditems. The ICommandItem interface allows you to get or set the properties of the commanditem such as caption, button image, statusbar message, tooltip, display style, help context ID, and more. The ICommandItem interface also provides methods to execute, delete, refresh, and reset the commanditem. Use ICommandBars::Find, ICommandBar::Find, or ICommandBar::Item to obtain a reference to a particular commanditem.
Members
Description | ||
---|---|---|
Action | The name of the VBA macro this command should run when pressed. | |
BuiltIn | Indicates whether this command item is built-in or if it was implemented through VBA. | |
Caption | The caption of this command item. | |
Category | The name of the category with which this command item is associated. | |
Command | A reference to the internal command object. | |
Delete | Removes this object from the commandbar. | |
Execute | Causes the command to execute. | |
FaceID | The bitmap that is used as the icon on this command item. | |
Group | Indicates if this command item begins a menu or toolbar group. | |
HelpContextID | The help context ID associated with this command item. | |
HelpFile | The help file associated with this command item. | |
ID | The unique integer ID associated with this command item. | |
Index | The positional index of this command item within its menu or toolbar. | |
Message | The status bar message for this command item. | |
Name | The name of this command item. | |
Parent | The menu or toolbar that this command item currently resides on. | |
Refresh | Causes the command to be redrawn. | |
Reset | Restores this command item's properties to that of the original. | |
Style | The display style of this command item. | |
Tag | The tag for this command item. | |
Tooltip | The tooltip for this command item. | |
Type | The type of this command item. |
CoClasses that implement ICommandItem
CoClasses and Classes | Description |
---|---|
CommandBar | CommandBar object. |
CommandItem | Command Item. |
See Also
ICommandBar.Popup Method | ICommandBar.Find Method | ICommandBar.Add Method | ICommandBar.Item Property | ICommandBar.CreateMacroItem Method | ICommandBars.Find Method