After you create your form and define its behaviors, properties, and settings, you’ll want to make it available to users. First, however, you’ll need to preserve your form in one of these two ways:
Save the form as a file.
Publish the form to a folder or other location.
You can save a form from the Form design dialog box by clicking the Microsoft Office Button and then clicking Save As. In the Save As dialog box, select the file name and location. The form file is saved as an Outlook Template file (.oft).
Publishing a form is a lot like saving the form. When you finish your form, you can publish it to a specific folder location. You can publish it to your Inbox or another folder in your mailbox, a public folder, the Organizational Forms Library (Exchange Server), or your Personal Forms Library.
Follow these steps to publish a form to a folder or forms library:
Click Tools, Forms, and then select Design A Form.
In the Design Form dialog box, select the location (such as User Templates In File System) containing the form that you want to publish.
Select the form that you want to publish, and then click Open.
In the Form group, click Publish, and then click Publish Form As to open the Publish Form As dialog box. (The first time you use the Publish Form button, the Publish Form As dialog will be displayed, but after a form has been saved once, the Publish Form button will simply save the existing form, overwriting the previous version.)
In the Look In drop-down list, select the folder or forms library where you want to publish the form. (The default is the Personal Forms Library.)
Type the display name and the form name.
Click Publish to save the form in the selected location.
Inside Out: Create a staging area for your forms
When you’re creating a form, it’s a good idea to keep the production version of the form separate from the development version. Create a staging folder where you publish the forms you’re working on. When you complete a form design, publish your form in this staging folder at regular intervals so that you don’t lose the modifications you’ve made to the form. Only people designing and testing forms for your organization should have access to this folder.
After you publish a form, the folder in which you publish it contains the form itself and all the underlying information that another person’s instance of Outlook 2007 needs to understand the form.
After you have created a custom form and saved or published it for common use, you will need to select the form in order to use it. Custom forms are normally stored in a location related to their expected use. Custom forms intended for common use, for example, are usually stored in an accessible network location. If you have a custom form intended for your own use, however, you would store it in the Personal Forms Library. Or if you want to use a form that you have saved to a folder on your local hard disk, you would store it using the User Templates In File System location.
In each of these cases, to locate your custom form, you select the appropriate location in the Look In drop-down list of the Choose Form dialog box, shown in Figure 28-19.
To use a custom form from these (or any other) locations, follow these steps:
Choose Tools, Forms, and then select Choose A Form.
In the Choose Form dialog box, select the location in which your custom form is stored (such as the Personal Forms Library).
Select the custom form that you want to use.
Click Open.
Users can’t access your custom form
After you’ve completed and published your custom form, you might hear from a user who reports receiving this message when trying to access the form: "The custom form could not be opened, and Outlook 2007 will use an Outlook 2007 form instead. The object could not be found." You should first make sure that your form is properly published. If the form is not published so that Outlook 2007 can find it, or if an .oft file is not available, Outlook 2007 won’t be able to open the file.
Sometimes, however, Outlook 2007 reports this error even when the form is available. The cause might be a corrupted file named Frmcache.dat. The Frmcache.dat file contains information that Outlook 2007 uses to prevent multiple instances of the same form from being loaded. Outlook 2007 checks the cache to see whether a form using the same message class name is in the cache before attempting to display a form. Outlook 2007 copies the form definition to the cache if the definition does not exist or loads the definition already in the cache, and then Outlook 2007 displays the form. In addition, if a change has been made to a form, Outlook 2007 copies the new form definition to the cache. The file is located in Users<profile name>AppDataLocalMicrosoftFORMS on a computer running Windows Vista™, or in Documents And Settings<profile name>Local SettingsApplication DataMicrosoftForms on a computer running Windows XP, or at WindowsForms on computers running earlier versions of Windows.
If this file is corrupted, reinstalling Outlook 2007 can solve the problem, but there is a simpler way. You could try closing Outlook 2007 and then deleting Frmcache.dat. Or you can locate an instance of Outlook 2007 that displays the form properly and copy that profile’s instance of Frmcache.dat to the profile of the offending instance, thus overwriting the file.
Publishing to local folders or to the Personal Forms Library is perfectly acceptable, but you might find that many of your solutions are destined for a wider audience that, in an Exchange Server environment, can be reached only through public folders.
For More Information About VBScript and Outlook
This chapter has presented a brief introduction to programming Outlook 2007 solutions. Because the skills you acquire as you learn to use and extend Outlook 2007 will pay off for a long time, you’ll undoubtedly want to deepen your understanding. There are numerous additional sources you can consult to do so.
Microsoft supplies a copious amount of documentation about Outlook 2007 and about building collaborative solutions around Outlook 2007. The online documentation for Outlook 2007 and the Microsoft Office Developer Center documentation (http://msdn2.microsoft.com/en-us/office) are probably the best in the industry for any product. Although the MSDN Web site (http://msdn.microsoft.com) has an overwhelming but well-organized body of documentation, you might want to consider using Microsoft Visual Studio 2005 Tools For Office Second Edition as well. Visual Studio 2005 Tools For Office not only offers more specific documentation than MSDN but also contains extremely useful code samples and other materials.
The 2007 Microsoft Office Resource Kit and a wide selection of Microsoft Press books can aid you in learning about VBScript, Microsoft Office system, and Microsoft Exchange Server development. Visit the Microsoft Press Web site at http://www.microsoft.com/learning/books/ to find the latest releases that discuss the most current technologies.