Command Events Command Enabled

The CommandEnabled event occurs whenever the enabled state of a menu bar or toolbar command changes. Because the same command can be accessed from multiple locations (toolbar, menu bar, shortcut menu), this event will fire for each command. This event takes two arguments:

Command — Returns a PivotCommandId constant and allows you to determine which command has been enabled or disabled. You can use the Object Browser to view the list of commands for this constant. Enabled — An object whose Value property indicates whether the command is enabled or disabled.

The event procedure in Hands-On 24-31 checks whether the Copy command has been enabled or disabled.

0 0

Post a comment