You can enhance your forms and applications by taking advantage of additional features available in Outlook. If you have any Microsoft Office products installed, you can tie into some of their capabilities. You can also add actions to your forms by customizing Reply and Forward and by using voting buttons. In this section, we'll take a look at these features.
Office document forms are similar to built-in Outlook forms, but there are enough differences to warrant highlighting this technology in its own section. With Office document forms, you can take advantage of the power of other Microsoft Office products in your applications as well as any development skills you already have. To create an Office document form, select Office Document from the File/New menu. Select the type of document you would like to create. Outlook will prompt you to either e-mail or post this document to someone else in your organization. Select the action that best suits your application: if you need to e-mail your new form to coworkers, create a new e-mail Office form; if you're posting the information to a public folder for others to read at their convenience, post the new Office form.
After creating your Office document form, you can customize the form by using either VBA inside of the Office document or VBScript inside of Outlook. Unlike the standard Outlook forms, Office document forms won't let you add new tabs. Therefore, the only way to customize the Office document form is to use the tools available for the particular Office application you used to create the document form. For example, to customize the values and layout in an Microsoft Excel spreadsheet form, you use Excel tools. A customized Excel document form is shown in Figure 5-24.
Figure 5-24 An Excel document form in design mode. Notice how the first page has been customized using the tools provided in Excel.
You can also use the custom properties inside your Office forms as Outlook view properties. For example, an Excel expense reporting form could use its cell values as properties in an Outlook view. This sharing of properties is implemented by creating custom properties in the Office application. You create custom properties in Word and in PowerPoint the same way, except that in Word, the custom properties link to custom bookmarks, and in PowerPoint, the custom properties link to objects in the presentation. Following is a description of how to create custom properties in Excel:
After you create a custom property to hold the value from the Office document, you can add it to your Outlook view. To do this, select the folder where you posted or e-mailed the Office document form. Right-click on the column headings for the view, and select Field Chooser from the menu. In the Field Chooser, open the drop-down list and choose User-Defined Fields In Folder. The Total field should be listed. You can use this property to group, sort, and filter your view. The only restriction on using this property is that you cannot edit it using in-cell editing in Outlook. The properties are read-only inside of Outlook, and you must use the Office document form to edit the properties. Figure 5-25 shows a view of expense reports inside an Outlook folder.
Figure 5-25 A view of expense reports inside an Outlook folder. The properties in the view are actually values from an Excel document form.
In design mode for Office documents, you can set the same form properties that you can set for default Outlook forms. These properties include changing the icon for the form, password-protecting the form, and establishing the form contact. For more information on these properties, see the section "Setting Default Form Properties" earlier in this chapter.
NOTE
Outlook also allows you to create custom actions for the form, which is discussed in the next section.
In the same way you can publish custom forms, you can publish your Office document forms so that they are available to all users in an organization. Office document forms display a unique message class determined by the Office application that they are based on. For example, an Excel expense report form could have a message class named IPM.Document.Excel.Sheet.8.Expense Report, and a Word beta agreement form could have a message class named IPM.Document.Word.Document.8.Beta Agreement.
Actions are either built-in or custom responses to a particular item on a form. They add dynamic functionality to your application with no coding at all. For example, in the Account Tracking application, individual contacts for the company can be created off the master company contact information. In a threaded discussion application, new items are created as responses to posted items. The following section explains how to create actions for Outlook items and associate those actions with custom forms, and it provides strategies for using actions in your applications.
By default, Outlook provides you with four built-in actions for items: Reply, Reply To All, Forward, and Reply To Folder. In many cases, you'll want to customize these actions or create your own. Figure 5-26 shows the Actions page, in which you create actions.
Figure 5-26 The Actions page of a form.
To create a new action, follow these steps:
NOTE
In some cases, you will want only the action to appear on the menu. For example, if you create a CommandButton control on your form and program the CommandButton control to execute the action when clicked, you might not want the action to also appear in the toolbar. In other cases, you will not want the action to appear on either the toolbar or the menu. For example, when the action is used in an event such as the close event for an Outlook form. In this case, you would not want users to be able to launch this action, only your application.
Actions and Hidden FormsActions can take advantage of hidden forms in your applications. Remember that checking the Use Form Only For Responses check box on the form's Properties page hides the form from the user when the user chooses a form to compose. Suppose you are writing a helpdesk application and on your form you want to include an action called "Resolved." The Resolved action launches a new form, which the technician fills out to mark a ticket as resolved. Suppose also that you do not want users creating their own resolved forms. You can hide the resolve form by marking it as a response form and then setting permissions on the folder that prevent users from reading the items posted there. Technicians can open the items and click the resolved action to resolve the ticket. Users will not see the resolved form in their Choose Forms dialog boxes.
In addition to creating new actions, Outlook allows you to modify and disable built-in and custom actions so that you can control which actions are available to the user. When you disable a built-in action such as Reply All, you can replace it with your own. Because disabling doesn't actually delete the action, you can reenable it. You can also modify a built-in action so that its functionality is consistent with your application.
You modify, disable, and delete built-in actions via the Actions page. To modify or disable the action, select the desired action on the Actions page and click the Properties button to access the Form Action Properties dialog box. To delete an action, select the desired action and click the Delete button. Once you delete an action, you have to re-create it to get it back. If there is any chance that you will need the action in the future, you're better off disabling it.