CommandBarEvents Property

See Also      Applies To

Returns an object providing events fired when the supplied CommandBarControl object is clicked.

Syntax

Property Get CommandBarEvents(ByVal Control As CommandBarControl) As CommandBarEvents

This syntax has these parts:

Part Description
Control The control which causes the event to fire.

Remarks

The CommandBarEvents property is used by an add-in to connect an event with a click of a CommandBarControl object, or to connect to the Click event of any member of the CommandBarControls collection.

The add-in must set the OnAction property to some string value. It can set this value after the CommandBarEvents property is called, and can reset it to a blank string which disconnects the event. If an add-in creates a control and fails to set the OnAction property to some valid string value, then no event is raised on the event object returned by the CommandBarEvents property.