CommandButton.Click Event (Outlook Forms Script)

Occurs when the user clicks inside the control.

Syntax

expression.Click

expression A variable that represents a CommandButton object.

Remarks

The following are examples of actions that initiate the Click event of the specified control:

  • Clicking a blank area of a form or a disabled control (other than a list box) on the form.

  • Clicking a CommandButton.

  • Pressing the SPACEBAR when a CommandButton has the focus.

  • Clicking a control with the left mouse button (left-clicking).

  • Pressing ENTER on a form that has a command button whose Default property is set to True, as long as no other command button has the focus.

  • Pressing ESC on a form that has a command button whose Cancel property is set to True, as long as no other command button has the focus.

  • Pressing a control's accelerator key.

Left-clicking changes the value of a control, thus it initiates the Click event. Right-clicking does not change the value of the control, so it does not initiate the Click event.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.