Designing and Using Custom Forms in Microsoft Outlook 2013

  • 7/15/2013
This chapter from Microsoft Outlook 2013 shows how you can extend the functionality of Outlook 2013 through custom design and programming.
  • Overview of standard forms, item types, and message classes

  • Creating custom forms from standard forms

  • Creating custom forms from scratch

  • Creating multipage forms

  • Adding and arranging controls

  • Adding graphics to forms

  • Adding user-defined fields

  • Publishing and sharing forms

  • Using forms effectively

EVEN without any custom programming, Microsoft Outlook 2013 provides an excellent set of features. In fact, many organizations don’t need anything beyond what Outlook 2013 offers right out of the box. Others, however, have special needs that Outlook 2013 does not address, 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 2013 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 Word 2013 and Outlook 2013 contact 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 2013 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 2013 to perform custom tasks or interact with other Microsoft Office 2013 system applications. This chapter starts you on the right path by explaining how Outlook 2013 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 2013 forms as part of a software solution for individual computing needs. It also examines the types of forms that you can modify and create and how the forms are created, published, and stored.

With Outlook 2013, 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 2013 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 email 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 2013 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 2013, a developer must understand them reasonably well. Obviously, the more you know, the more powerful your Outlook 2013–based solution will be.

Outlook forms

Outlook 2013 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

  • Distribution list form

  • Meeting request form

  • Message form

  • Note form

  • Post form

  • RSS article form

  • Task form

  • Task request form

As this list of Outlook 2013 forms indicates, the basic item types available in a typical Outlook 2013 installation are each represented by a corresponding form. The Outlook 2013 forms in this list match the ones that 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 27-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.

Figure 27-1

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

Outlook item types

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

  • MailItem

  • ContactItem

  • TaskItem

  • AppointmentItem

  • PostItem

  • NoteItem

These item types represent built-in functionality. If you have ever used Outlook 2013 to create an email message or to add an appointment to your calendar, you have benefited from this functionality. Of particular importance is the fact that this functionality is accessible to you as you develop custom solutions with Outlook 2013. Outlook 2013 provides corresponding forms for each of these item types, and these standard forms are designed with behaviors that directly relate to the item types that they represent. You can extend the behaviors of these forms and use 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 2013 to incorporate the functionality of other Microsoft Office applications such as Microsoft Word 2013, Microsoft Excel 2013, Microsoft InfoPath 2013, Microsoft PowerPoint 2013, Microsoft Project 2013, Microsoft Visio 2013, 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 2013 solution, it’s helpful to know what a message class is and how it relates to Outlook 2013 form development. A message class represents to Outlook 2013 internally what an item type represents to a user or developer externally. In other words, when a user opens an email message from the Inbox, that message is a MailItem. Internally, however, Outlook 2013 calls it by a different name: IPM.Note. IPM (which stands for interpersonal message) is a holdover from earlier generations of Microsoft’s messaging systems. All messages in Outlook 2013 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.DistList

  • IPM.Appointment

  • IPM.Task

  • IPM.Post

  • IPM.Activity

  • IPM.Schedule.Meeting.Request

  • IPM.StickyNote

  • IPM.TaskRequest

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