Tips for Converting Microsoft Outlook Forms to HTML


Before You Start

Before converting an Outlook form to HTML, remove any extra functionality and form pages that will not be needed in the HTML version. Doing so will simplify the generated code, making it easier to modify and comprehend.


Use SetInitialValue to Manipulate Custom Fields

Custom fields can be set by referencing the Fields collection of the message object. For example, the following code fragment sets the value of the custom field "UserPropertyField" to "Value":

Const sGUID = "{2903020000000000C000000000000046}" 
objOneMsg.Fields(sGUID & "UserPropertyField") = "Value"

The special form of field name used above instructs CDO to use the MAPI custom property set when resolving the field name. However, the previous script will fail if the field has not yet been registered on the message object. To help address this situation, the HTML Form Converter also generates a script library (Bindprop.inc) that can be used to simplify the handling of custom fields.

The most commonly used script function is SetInitialValue. This function is used to set the initial values of any field on the form, including custom fields. If by chance the field has not yet been added to the form, SetInitialValue will first register it.