The information in this article applies to:
SUMMARY
This article describes the three events that are supported by fields and
controls in Microsoft Outlook 98. MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspOutlook supports one event for controls, the Click event, which is a VBScript procedure that is run whenever a user clicks on a control. Outlook also supports two events for detecting when the value of a field has changed. The PropertyChange event is used with standard Outlook fields and the CustomPropertyChange event is used for user-defined, or custom, fields. Both of these events function the same. The Click EventThe Click event occurs when the user clicks a form control. You can create as many Click event procedures as you have controls on a form. The name of each event procedure is the name of the control (such as "CommandButton1"), followed by an underscore character (_) and the word "Click." The following example displays a greeting containing the logon name of the current user whenever the button named "CommandButton1" is clicked:
Controls other than a command button are commonly bound to a field so that the control's value is stored. This is commonly done with list boxes, text boxes, or other controls, such as check boxes and option buttons. However, the Click event will not fire when a control is bound. You must use either the CustomPropertyChange or PropertyChange event to detect a change in the value of the field. For more information about the Click event and bound controls, please see the following article in the Microsoft Knowledge Base: Article-ID: Q181216 Bound Control Does Not Support Click Event The PropertyChange EventThe PropertyChange event occurs when one of the item's standard fields, or properties, is changed. The property name is passed to the procedure, making it possible for the procedure to determine which property was changed. The following example disables setting a reminder for an item:
The CustomPropertyChange EventThe CustomPropertyChange event occurs when one of the item's custom fields, or properties, is changed. These properties are the nonstandard properties added to the item at design time. The property name is passed to the procedure, making it possible for the procedure to determine which property was changed. The following example enables a control when a Boolean field is set to True.
Adding a Control and an Event to a Custom FormTo add a control and an event to a custom form, follow these steps:
REFERENCESFor more information about creating solutions with Microsoft Outlook 98, please see the following articles in the Microsoft Knowledge Base: Q180826 Resources for Custom Forms and Programming Additional query words: OutSol OutSol98 ListBox CheckBox OptionButton TextBox ListBoxes CheckBoxes OptionButtons TextBoxes
Keywords : kbprg OffVBS FmsEvnt |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |