Special Edition Using Microsoft Office Outlook 2003

Now that you have your form in design mode and know how to manipulate the pages in your Outlook form, you're ready to start adding fields and controls to your form. A field is a distinct piece of information that Outlook interprets, such as the subject line of a message or the start date of an appointment. Each Outlook item type contains a set of fields. The message form contains fields for To, CC, BCC, Subject, Message Body, Flag Status, Importance, and Sensitivity. This is only a partial listing of the fields associated with a message. Many other fields are stored behind the scenes. You've worked with Outlook's fields in other ways if you've used the Advanced Find feature of Outlook or if you've ever filtered a view.

Outlook groups fields into sets to make them easier to find and organize. Some predefined field sets include

  • All Mail fields

  • Address fields

  • Date/Time fields

  • All Post fields

  • Fax/Other Number fields

  • All Journal fields

There are many other field sets you can choose from. Outlook provides field sets to make it easier for you to find the field you're interested in.

When you design a form, Outlook provides a Field Chooser, shown in Figure 32.6, for you to use to select a field to display on your form.

Figure 32.6. The Field Chooser lets you add fields to your form.

To choose a different field set, use the drop-down list in the Field Chooser. You can also add a new field directly from the Field Chooser.

TIP

If you don't see the Field Chooser when you design your form, select Field Chooser from the Form menu.

Adding a Field to Your Form

To add a standard field to your form, display the Field Chooser if it isn't already visible. Select the appropriate field set from the Field Chooser's drop down and scroll to find the field you want to add to your form. Drag the field from the Field Chooser onto the form page. You can drag as many fields as you want onto each form page you have available.

Creating Custom Fields

Outlook enables youto use any available standard field on any custom form. However, Outlook's standard fields might not completely meet your needs. If that's the case, you can create custom fields to add to your form. Use the Field Chooser to create a new custom field using the following steps.

  1. Click the New button on the Field Chooser to display the New Field dialog box (see Figure 32.7).

    Figure 32.7. Use this dialog box to add a new custom field.

  2. Enter a name for your new field. You can name your field with letters, numbers, and certain characters. You cannot use the characters [, ], _, and #.

  3. You can create many different types of fields. Use the Type drop-down list to choose the field type you need.

  4. Based on the field type you select, you can also select a field format. For example, creating a Yes/No field, you can choose from a variety of different field formats.

  5. Click OK to save your custom field. It will appear in the Field Chooser in the User Defined Fields in Folder or User Defined Fields in Inbox field set.

You can create as many custom fields as you want.

Naming Custom Fields

Conventional programming wisdom states that you should follow standard field naming conventions when creating your fields. This would mean that creating text field names such as txtItemRequired or number fields with a name such as intNumAttachments. Although this is good programming practice, in Outlook it can provide some interesting challenges.

When you choose tos display a custom field in a table view of a folder, the column heading of that custom field is the field name. You could end up with a column called intNumAttachments. Even though you might know what that field represents, your users would probably appreciate a friendlier name, such as NumberOfAttachments. You can, of course, format your columns to change the display name, but that must be done on each individual machine that displays the custom field. So, even though it's not perfectly legal programming to create purely descriptive field names, in Outlook forms development, it provides some benefits.

Категории