Tips for Developing Microsoft Outlook Forms


Implementation Tips for Microsoft Outlook Forms

When referring to values of user-defined properties, remember that field names are case-sensitive. A few bugs were caused by not matching the case used in Item.UserProperties("FieldName") to "fieldName" in the form definition.

Automatic vertical and horizontal resizing of a control can be achieved by setting the LayOutFlags property of a control at run time. For instance, you can automatically resize a control vertically by setting LayOutFlags = 65. To automatically resize a control named "txtBox" appearing on the page named "P.2", use the following script:

Set MyPage = Item.GetInspector.ModifiedFormpages("P.2")
MyPage.txtBox.LayOutFlags = 68

It is important to note that LayOutFlags can only affect one control in a framed group, and it has to be the one with the smallest tab order. In other words, only one control can be set for automatic resizing at a time.


Saving Microsoft Outlook Forms

After you have edited a form in Microsoft® Outlook®, you want to save it. But if you merely click Save and close the form, you lose your changes. To keep your changes, you need to click Save As, and overwrite the old form. Additionally, you can publish the form to update the version in the forms library.

So, why doesn't Save work? It turns out to be the Save button of the form, not of the form-development interface of Microsoft Outlook. Clicking this button invokes the same action as the form will when it is bound to a message object. However, since the form is in design mode and isn't bound to an object, the save operation does nothing.