Programming MicrosoftВ® OutlookВ® and Microsoft Exchange 2003, Third Edition (Pro-Developer)

After customizing your forms, you need to make them available to your users. You can distribute your forms to users in three ways:

The following sections describe each of these methods in detail.

Publishing a Form in a Forms Library

As you learned in Chapter 2, Outlook supports four types of forms libraries, and each type meets a specific need for forms publishing:

Note that Outlook also allows you to create personal folder (.pst) files. These files implement the same functionality as your personal mail folders, so you can create new folders in these personal store files and publish forms to the folders in your PST. Because you can save the forms to your local hard disk, you can e-mail or copy them to a floppy disk for distribution.

To publish your forms to a forms library, follow these steps:

  1. In design mode, from the Tools menu, choose Forms and then Publish Form As.

  2. In the Look In drop-down list, select the forms library where you want to publish the form.

  3. In the Display Name box, type the friendly name of your form. Outlook automatically fills in the Form Name box. (Note that this name will appear in the caption at the top of the form.) If you want to use a form name that is different from the display name, type a name in the Form Name box.

  4. Click Publish.

Saving the Form Definition with the Item

As you learned earlier in this chapter, you should save the form definition with an item when you know that users will not have the form anywhere in their systems. If the definition is saved with the item, Outlook will use the saved version of the form, which is the most current. If the definition is not saved with the item, Outlook will look for the form definition in other locations. To save the form definition with the form, in design mode, click on the form's Properties tab. Select the Send Form Definition With The Item check box.

You must keep two issues in mind when you consider whether to save the form definition with the item. The first issue is security ”particularly when VBScript is used to customize the form. To alleviate security concerns, Outlook provides a security measure when users receive an item with a form containing VBScript. Because Outlook supports customizing forms with VBScript, this is a necessary precaution. Without it, users could send malicious forms containing VBScript that could, for example, delete data on your hard drive. This security measure displays a warning message box, as shown in Figure 4-23, that allows the user to enable or disable the VBScript in the form. This security warning appears only if the form has the definition saved with it, is not published in any of the forms libraries, and has VBScript included with it. Outlook 2003 does not even display the warning dialog box ”it simply disables all VBScript behind forms that are not published.

Figure 4-23: The warning message that is displayed when a form has the definition saved with the item and also contains VBScript

The second issue is that when you save the form definition with the item, you cannot take advantage of the automatic update capabilities of Outlook forms. For example, if you change the form, the new version of the form will be included only with new items you create based on it. Any old items will use whatever form definition was originally saved with the item.

Saving the Form as an .oft File

Outlook allows you to save your forms as Outlook templates, or .oft files. This enables you to embed the form in a mail message and send it to users inside and outside the organization. Your users open the form using the attachment, and they either return the form completed or publish the form in a forms library. Saving your custom forms as .oft files is one way to create backups of your custom forms. To save a form as an .oft file, in design mode, choose Save As from the File menu. In the Save In box, select the location to which you want to save your file. In the File Name box, type a name for your file.

Категории