The EnhancedLitCrit form's script uses the Outlook object model in a number of ways. The following paragraphs discuss a few of them.
The Application object of the Microsoft Outlook object model is similar to the CDO Session object in its pervasiveness. The Outlook Application object represents the entire Microsoft Outlook application. When you receive a session on the form, you are using the Microsoft Outlook object model, while when you receive a session on the server, you are using CDO.
The Application.GetNameSpace("MAPI") call returns to you the Outlook session; from this you can obtain the display name of the current user, with Application.GetNameSpace("MAPI").CurrentUser.
Application.GetInspector.Controls helps identify what form elements have changed or been reset. This call retrieves the active page of the form or the active item, namely the page that has been modified. Because the EnhancedLitCrit form uses only one page ("Message"), all new or changed information will be on that page. Still, using GetInspector makes the code reusable because other pages could be added later.
Using the Item collection is the way to access properties on an object. The properties in the Item collection are the values of fields on the form which when bound to controls can be visible. They can also be user-defined, with any data type.
The Item_PropertyChange event is fired when a standard property like Subject, From, or To is changed. This causes the following subroutine to be called:
Sub Item_PropertyChange(ByVal Name)
The Item_CustomPropertyChange event is fired when the value of a custom property changes. This causes the following subroutine to be called:
Sub Item_CustomPropertyChange(ByVal Name)
An online Help file is available with interactive hierarchical charts of the Microsoft Outlook object model. For more information, see Obtaining Online Help.