OL98: Click Event Behavior for Standard Controls

ID: Q231594


The information in this article applies to:


SUMMARY

This article describes how the standard controls that are included with Microsoft Office and Outlook, respond to the Click event using Visual Basic Scripting Edition (VBScript) on a custom Outlook form.


MORE INFORMATION

The Click event is the only event that Outlook supports for controls. However, for some controls, the Click event may not fire if the control is bound to a field, or it may not fire at all.

For additional information about the differences between fields and controls, and how they are typically bound together, please see the following article in the Microsoft Knowledge Base:

Q182362 OL98: How to Use Fields and Controls with VBScript
If a control is bound to a field, the Click event does not fire. However, either the PropertyChange or the CustomPropertyChange event typically fires because data is changing in the underlying field.

The following table summarizes whether or not the Click event will fire under various circumstances:


                                     PropertyChange or
                                     CustomPropertyChange
   Control         Unbound   Bound   event fires when bound?
   ---------------------------------------------------------
   Label            Yes       No              N/A
   TextBox          No        No              Yes
   ComboBox         Yes(1)    No              Yes
   ListBox          Yes(1)    No              Yes
   CheckBox         Yes       No              Yes
   OptionButton     Yes       No              Yes
   ToggleButton     Yes       No              Yes
   Frame            Yes       N/A             N/A
   CommandButton    Yes       N/A(2)          N/A
   MultiPage        No(3)     N/A             N/A
   TabStrip         No        N/A             No
   ScrollBar        No        No              No
   SpinButton       No        No              No(4)
   ImageControl     Yes       No              No

   N/A = Not applicable

   (1) These controls must have possible values set in the control
       in order for the Click event to fire.

   (2) Commandbuttons are bound to Outlook dialogs, such as the address
       book dialog, Full Name dialog (contact form), and such, so the
       Click event is not applicable to VBScript.

   (3) The Multipage1_Click event doesn't fire, but the Page1_Click
       event fires when the user clicks in the body of an individual
       page. However, this event does not typically provide useful
       functionality for a solution.

   (4) To use a Spinbutton, you bind the Spinbutton and a Label or Textbox
       control to the same field. The Label or Textbox will then show the
       current value of the SpinButton. 


REFERENCES

For more information about creating solutions with Microsoft Outlook 98, please see the following articles in the Microsoft Knowledge Base:

Q180826 OL98: Resources for Custom Forms and Programming
Q182349 OL98: Questions About Custom Forms and Outlook Solutions

Additional query words: OutSol OutSol98 vbscript 98


Keywords          : kbdta OffVBS 
Version           : WINDOWS:
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: May 18, 1999