Using Office Documents to Create Outlook Forms

If you have installed Outlook 2007, you probably also have Word 2007, Excel 2007, and PowerPoint 2007 installed. These other programs provide an even more powerful Outlook 2007 form solution: You can use documents, spreadsheets, and slide presentations as the form of a message. For example, suppose that you created a form that required a user to enter several values and send the form to someone else. The recipient then has to type those values into an Excel 2007 spreadsheet. Wouldn’t it make more sense to have the first user type the values directly into the spreadsheet at the outset? If your company already uses an Excel 2007 spreadsheet for expense reimbursements, you can leverage this by letting employees use the spreadsheet as they always have—the only difference is that each employee will now set a recipient or a public folder as the spreadsheet’s destination.

Although you could have the users open the document, make changes, and then choose File, Send To, Mail Recipient to mail the document, you might prefer to incorporate the document into a standard form. For example, perhaps you want to broadcast an Excel 2007 spreadsheet to a group of users to show sales status or other data. You can create a standard message form, but in place of (or in addition to) the message body, add an Excel 2007 custom control that pulls the spreadsheet data from a server, updating the data when the user opens the form from his or her Inbox.

Covering this type of form development falls outside the scope of this chapter, but you might need only a nudge in the right direction to begin adding these custom controls to your own forms.

Here’s how:

  1. In Outlook 2007, choose Tools, Forms, Design A Form to open the Design Form dialog box.

  2. Select Message in the Standard Forms Library, and then click Open.

  3. Resize the message body control to make room for the Spreadsheet control.

  4. Click the Control Toolbox icon, right-click the Control Toolbox, and then choose Custom Controls to open the Additional Controls dialog box.

  5. Scroll through the Available Controls list to locate and then select the Microsoft Office Spreadsheet 11.0 control. Click OK to add the Spreadsheet control to the Control Toolbox.

  6. Drag the spreadsheet control onto your form. Figure 28-16 shows a Spreadsheet control added to a message form.

    You can add custom Microsoft Office system controls to a form to publish or accept data input.

    Figure 28-16. You can add custom Microsoft Office system controls to a form to publish or accept data input.

  7. Resize the Spreadsheet control to fit the form as needed. Right-click the toolbar portion of the control, and then click Advanced Properties.

  8. Use the properties in the control’s Properties dialog box to specify the data location and to define the data.

  9. Make other design changes as needed to the form, and then save (by clicking the Microsoft Office Button and then clicking Save As) or publish the form (by clicking Publish in the Form group). For more information about publishing forms, see "Publishing and Sharing Forms" later in this chapter.

If you browse through the Additional Controls dialog box, you’ll find a wide range of additional controls you can add to your forms. You can add charts, PivotTables, database forms, and many other controls to create powerful and useful forms.

A Word About Form Regions

Outlook 2007 provides enhancements to the ability to develop custom forms, enabling you to define form regions that can be added to existing forms or as entirely separate regions. Earlier versions of Microsoft Outlook provided restricted functionality when creating custom forms—if you wanted to add a few fields to an existing form, Microsoft Outlook required you to develop a new custom form. Further, customized forms could not be displayed in the Reading Pane, a common way for Microsoft Outlook users to review their mail. These factors presented limitations on developing messaging solutions based on Microsoft Outlook.

In Outlook 2007, however, there is a new ability to define and use form regions—a defined section of a form that can contain controls and information from external applications and data sources.

These new form regions can be classified into types of regions: Adjoining, Separate, Replace, or Replace All. Adjoining regions provide the ability to add a region to an existing built-in or custom form. Thus if you want to customize an existing form, just adding new fields, information, or controls, you can use an Adjoining region. You also have the option to display an Adjoining region in the Reading Pane. When you want to replace one or more tabs on a form, you need to use Separate regions. Using a Separate region that replaces the default (first) page of a form enables your form to be displayed in the Reading Pane. Using Separate regions, you can add information in the middle of a form or customize the entire form to meet your requirements. A Replace region replaces the default page, and a Replace All region replaces all of the pages in the specific form, effectively creating a new form of the designated message class.

One disadvantage of using form regions is that they require that both the sender and the recipient have the same add-in component used in the form region installed on their computers. Senders and recipients of forms using form regions, however, are not dependent on having shared access to Exchange Server public folders.

Custom form development frequently requires creating custom code to process the associated business logic, which in earlier versions of Microsoft Outlook left you programming Microsoft Visual Basic Scripting Edition (VBScript) in Notepad to develop the necessary coding. With form regions, however, your coding can be developed in your preferred Integrated Development Environment (IDE) and is installed and implemented as an add-in to Outlook 2007. Thus, your code can access data from sources other than Outlook 2007, listen for events on controls, and monitor and react to other Outlook 2007 data.

To create a form region, start as you would to design a form. Choose Tools, Form, Design A Form, and then select a form of the message class that you want to use as the base for your new form. In the Design group on the Developer tab, click the Form Region button to display the New Form Region and Open Form Region options, as shown in Figure 28-17.

You can add control form content and functionality by creating form regions in a form.

Figure 28-17. You can add control form content and functionality by creating form regions in a form.

When you choose to create a new form region, Outlook 2007 creates a new tab named Form Region, as shown in Figure 28-18, where you can specify fields, controls, and properties for the region.

Adding a new form region creates a new tab in the form.

Figure 28-18. Adding a new form region creates a new tab in the form.

Implementing form regions, however, requires the development of an add-in and a related XML file as well as registering the add-in in the registry. As a result, using form regions demands a bit of software development as well as the creation of related files.

The details of developing solutions using form regions is beyond the scope of this book. The Microsoft Developer Network site (www.msdn.com) includes a number of articles explaining how to use Microsoft Visual Studio® Tools for Office to create the requisite add-in and support files. See the information at the following URLs for specific information about creating and implementing form regions in Outlook 2007:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset