Chapter 28. Designing and Using Forms

Even without any custom programming, Microsoft® Office Outlook® 2007 provides an excellent set of features. In fact, many organizations don’t need anything beyond what Office Outlook 2007 offers right out of the box. Others, however, have special needs that are not addressed adequately by Outlook 2007—perhaps because of the way these organizations do business or because of specific requirements in their particular industries. In such cases, you have ample opportunity to extend the functionality of Outlook 2007 through custom design and programming.

For example, you might need to add some fields to your message forms or your meeting request forms. Perhaps you need an easier way for users to perform mail merge operations with Microsoft Office Word 2007 and Outlook 2007 contacts lists. Maybe you simply want to fine-tune your forms to add your company logo, special instructions, or warnings for users.

Whatever your situation, you can easily make changes to the existing Outlook 2007 forms, or you can even design new ones. The changes you make can be simple or complex: you might add one or two fields to the standard contact form, or you might add a considerable amount of program code to allow Outlook 2007 to perform custom tasks or interact with other 2007 Microsoft Office system applications. This chapter starts you on the right path by explaining how Outlook 2007 uses forms and how you can customize them to suit your needs. If you aren’t comfortable programming with Microsoft Visual Basic® for Applications (VBA), don’t worry—you can accomplish a lot with custom forms without ever writing a single line of program code.

Forms are such a normal part of everything we do on computers that we sometimes take them for granted. It’s still true, however, that a lot of programs used all over the world can be accessed only with screens that provide monochrome text and puzzling menus with strange codes and submission sequences. With their versatility and ease of use, forms offer a revolutionary approach—and you can unlock their power with several mouse clicks and some solid planning. This chapter discusses using Outlook 2007 forms as part of a software solution for individual computing needs. It also examines the types of forms you can modify and create and how the forms are created, published, and stored.

With Outlook 2007, you can employ two basic strategies for form development. The first is to use or modify a standard form. The second is to create your own form from scratch. With either strategy, it’s important to remember that you’re programming events that are specifically associated with the item involved, not with the Outlook 2007 application generally. In other words, when you put code behind your form, you’re dealing with events related to the item that’s represented by the form. For example, if you were to design a form to create a custom e-mail message, you’d probably program a common event named Item_Send, which occurs when the item (the message) is sent. You couldn’t program the form to respond to an event that fires (that is, occurs or executes) when the item is specifically sent from the Outbox to another user’s Inbox or when the user’s view changes from one folder to another. This is because in form development, you can access only the events associated with the item in question.

Overview of Standard Forms, Item Types, and Message Classes

Outlook 2007 uses a combination of forms, item types, and message classes as its fundamental components. Although you don’t need to understand much about any of these three components to use Outlook 2007, a developer must understand them reasonably well. Obviously, the more you know, the more powerful your Outlook 2007–based solution will be.

Outlook Forms

Outlook 2007 provides numerous predefined forms that you can use as the foundation of your form-based solution. These standard forms include the following:

  • Appointment form

  • Contact form

  • Journal entry form

  • Meeting request form

  • Message form

  • Post form

  • Task form

  • Task request form

  • RSS article form

As this list of Outlook 2007 forms indicates, the basic item types available in a typical Outlook 2007 with Microsoft Exchange Server application are each represented by a corresponding form. The Outlook 2007 forms in this list match the ones you are used to working with on a daily basis, so you are not starting with a blank slate when you want to customize a form for your own use.

Each of these forms comes with built-in user interface elements and corresponding functionality. For example, the appointment form shown in Figure 28-1 has interface elements and functions that relate to setting appointments, such as generating reminders and controlling the calendar display. The contact form, in contrast, is designed to permit the addition or modification of contact information.

The appointment form is one of the standard forms that you can use in Outlook 2007.

Figure 28-1. The appointment form is one of the standard forms that you can use in Outlook 2007.

Outlook Item Types

Several basic item types are part of an Outlook 2007 installation. Among the 2007 Microsoft Office system VBA item types that you can use are the following ones specific to Outlook 2007:

  • MailItem

  • ContactItem

  • TaskItem

  • AppointmentItem

  • PostItem

  • NoteItem

Note

Other item types are built into Outlook 2007, including the JournalItem and DistListItem types. This book does not cover these additional types, but you can find information about them by consulting the Microsoft MSDN® Web site (http://msdn.microsoft.com) and searching on these item types.

These item types represent built-in functionality. If you have ever used Outlook 2007 to create an e-mail message or to add an appointment to your calendar, you have benefited from this functionality. Of particular importance, this functionality is accessible to you as you develop custom solutions with Outlook 2007. Outlook 2007 provides corresponding forms for each of these item types, and these standard forms are designed with behaviors that directly relate to the item types they represent. You can extend the behaviors of these forms and leverage all the functions and properties of the item types, some of which are not exposed in the standard forms. In addition, you can reach beyond Outlook 2007 to incorporate the functionality of other Microsoft Office system applications such as Microsoft Office Word 2007, Microsoft Office Excel® 2007, Microsoft Office InfoPath® 2007, Microsoft Office PowerPoint® 2007, Microsoft Office Project 2007, Microsoft Office Visio® 2007, and any application or control that exposes a programmatic Component Object Model (COM) interface.

Outlook Message Classes

Although forms and item types are the basic elements you need to understand to create a custom Outlook 2007 solution, it’s helpful to know what a message class is and how it relates to Outlook 2007 form development. A message class represents to Outlook 2007 internally what an item type represents to a user or developer externally. In other words, when a user opens an e-mail message from the Inbox, that message is a MailItem. Internally, however, Outlook 2007 calls it by a different name, IPM.Note. IPM (interpersonal message) is a holdover from earlier generations of Microsoft’s messaging legacy. All messages in Outlook 2007 are representations of an IPM of some sort. An appointment calendar item, for example, is an IPM.Appointment. The list of default message classes includes the following:

  • IPM.Note

  • IPM.Contact

  • IPM.Appointment

  • IPM.Task

  • IPM.Post

  • IPM.Activity

  • IPM.Schedule.Meeting.Request

  • IPM.POST.RSS

  • IPM.Task.Request

Again, unless you’re developing a fairly sophisticated collaborative solution, these message classes won’t surface often. However, understanding what they mean to Outlook 2007 will help as you progress in your use of the program and in developing Outlook 2007 solutions.

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

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