Most organizations (if not all) use custom forms in some way to communicate, move, tabulate, survey, and record information in the workplace, whether the workplace is an in-home small business or a worldwide enterprise. Often, you or
another individual within the company is responsible for creating some of these forms because your company has specific needs that require customized forms (that is, forms that are not readily available from a supplier). Creating these forms the
"old-fashioned" way meant simply drawing boxes on a piece of paper (with text identifying each box's purpose) in an organized collection, printing multiple copies of these forms, and making them available to others in your workplace.
Microsoft Exchange Forms Designer (EFD), a new application that comes with Microsoft Exchange, provides a way to create electronic forms (forms that are sent electronically across the computer network) to replace the old fashioned forms to which you are
accustomed. The Forms Designer does the same things for electronic forms that your pencil, typewriter, and printer does for paper forms. In this chapter, you use EFD to create an expense report form that you can use in your company. The techniques
demonstrated in this chapter will be applicable to any type of EFD you will want to design.
The Exchange Forms Designer (EFD) is a tool that enables you to easily create custom e-mail forms for your organization without writing a single line of code; you don't have to be a programmer to design Exchange forms! EFD provides a simple,
easy-to-use, drag-and-drop interface that enables you to visually create your forms. A simple wizard gets you started, and EFD then makes it easy for you to design the form and install it into Exchange, making it available to everyone in your organization.
If you want to add functionality to your Exchange form that is beyond what is provided in EFD, EFD creates forms that are extensible. This means that after you create a fully working Exchange form application with EFD, you can go further and make custom
modifications to it using the Microsoft Visual Basic programming language. After you design your form with EFD, EFD produces the Visual Basic source code that builds the form. You can ignore this source code and let EFD do everything for you automatically.
However, if you are a programmer, or someone interested in programming, you can view the source code to study the internals of e-mail messaging in Microsoft Windows, modify the source code, and rebuild and install the form with added functionality or
special customization. Note that the subject of extending your Exchange forms with Visual Basic is covered lightly at the end of this chapter in the section, Related Topics Extending the Expense Report Form with Visual Basic, but is not considered within
the scope of the topic discussed here. This chapter primarily focuses on developing forms without programming. For more information on extending forms, read the Application Designer's Guide that came with your Microsoft Exchange Forms Designer.
To many, it is not obvious what exactly an Exchange form is. Assuming that you are familiar with what a standard e-mail message is (see Figure 27.1), start by recognizing your standard e-mail message as nothing more than a simple form that contains only
envelope fields (the place where you enter To:, Cc:, Subject:, and so on) and a single message body field (the place where you type or read your actual message).
Forms can be made up of several windows, and forms you design with EFD will generally have more than one. For example, a standard e-mail message you could create in EFD might have a Compose window, a Read window, a Forward window, and a Reply window.
Each window represents a different view of the form for each context in which the form will be used (for example, a Reply window appears when you want to reply to an e-mail message; that is, you use this window to type in your reply). Together, the windows
define the form.
FIGURE 27.1. A standard e-mail form.
All you are doing with EFD is creating more functional forms that, besides the basic envelope and message body fields, might have list boxes from which users make selections, multiple text fields into which they enter data, or even picture boxes so you
can decorate your form with pictures.
How do forms fit into the workplace? As the Exchange administrator, it will probably be your responsibility to address this problem in your organization. Generally, whenever you need to obtain information in an organized fashion, you should use forms.
Several very useful forms ship with the sample applications that come with EFD. You'll also find several forms from independent Exchange form developers; some of these might be perfect for your organization. Because designing forms is so easy with EFD,
you'll probably find that several people in your own organization will design them when the need arises (or even just for fun). But often, it will be up to you to determine what forms are needed and then to design them.
You can design a form for practically every type of activity in your organizationa form that enables employees to check out books from the company library; perform a company-wide inventory of computer equipment at everyone's workstation; conduct
surveys, employment reviews, or job interviews; or to disperse reports to all the employees. And you aren't limited to just your local workplace. If your business has people at remote locations, they can access the forms created by EFD, too. All they need
is the Exchange Client running on their computer and a way to connect to the Exchange server (by WAN, modem, or ISDN).
After you've created a form, EFD makes it easy for you to install the form into the Exchange server so that all the Exchange users in your organization can send and receive the forms.
As the Exchange administrator, you will have certain roles to perform to incorporate EFD into your company. This section summarizes what these roles are. For more information, Refer to your Exchange Server documentation.
You will need to install the EFD software before you can begin to design Exchange forms. You find the installation files for EFD on the same distribution CD and subdirectory as the Exchange client software, under EFDSETUP. Note that EFD setup cannot be
completed unless you already have an Exchange client installed.
From the \EFDSETUP subdirectory of the Exchange Client CD, run setup.exe. Choose the Typical setup option to install all of EFD's available features. This will include the installation of some of the sample applications that come with Exchange. These
sample application files will be installed under \EFDFORMS\SAMPLES.
Opening these sample application files in EFD and examining them is an excellent way to familiarize yourself with how EFD can be used.
Other people in your organization who will be designing forms will also need to have EFD installed. We suggest you create a share point (a shared directory) on your Exchange server from which others can install EFD. To do so, simply copy the entire
EFDSETUP directory from your CD to this share point.
In order to make forms available for Exchange users, you must place the forms into a forms library that is available to your Exchange users. The Organization Forms library is such a library. Examples of other forms libraries are Personal Forms Library,
Public Folder Library, and Personal Folder Library, but these are not necessarily available to all users. For example, forms installed into your Personal Forms Library are accessible only to you.
A library is located in Exchange where you put your forms so users can access them. You can choose to have one library where all your company's forms are located or you can make separate libraries to organize your forms according to topic, security access, departments, and so on.
You use the Microsoft Exchange Administrator to establish an organization forms library. (We assume use of the default name of Organization Forms, but you can modify this name as you wish when you create the library.)
To create an Organization Forms Library, follow these steps:
The Organization Forms library you just established is now visible in the Organization Forms Library Administrator dialog box. Leave this dialog box open; next, you'll need to set permissions to use the Organization Forms library.
The permission level for the Organization Forms library is set to Reviewer by default. A user with Reviewer permission can read only existing itemssimilar to having read-only access to a file on your hard drive or on a network share.
As the administrator, you will need to give yourself Owner permissions to the Organization Forms library so that you can fully administer your company's forms.
To do so, follow these steps:
You will now be able to perform every available administration task on the Organization Forms library, including the installation of forms.
As the Exchange administrator, you might be responsible for providing forms to your Exchange users that they can use in their daily work to improve communication and efficiency in the workplace. Your first thought might be to create these forms
yourself. However, you should be aware that there are other resources available from which you can obtain forms that can do the job you need. Besides creating the forms yourself, you might want to consider looking for other solutions, such as the Exchange
Application Farm (see the section Other Sources of Information at the end of this chapter) page on the Web. The Exchange Application Farm is a place where you can find and contribute application forms for others to share. Other sites where you can locate
consultants who develop Exchange form applications should be available.
As the administrator, you will probably want to create public folders for some of your forms. Forms in public folders can provide information updates to the entire organization quickly and in one central location. You can build custom views for the
public folders in the Exchange Viewer and enable users to see important information at a glance. When users post forms to a specially designed public folder, they can use the Exchange Viewer to quickly view the information from the forms.
The following is a quick overview of the entire design process involved in building a custom form with EFD. Later, in the section A Sample Expense Report, you build a sample expense report Exchange application that takes you through this design process
in more detail.
As with any design process, the first thing you need to do is plan. Make sure you know what you want before you get started. What does the form need to do? What problem is it trying to solve? Where is this form supposed to go, to other users or a public
folder? Do you want the recipient(s) to see the information in the form differently than the way the sender sees it? You should answer questions like these before you begin creating the form.
Without EFD, creating forms can be extremely complicated if you are not a skilled developer familiar with Exchange messaging concepts. For this reason, EFD begins with a Wizard to help you establish the basics of your form. The Wizard asks you a series
of questions about the type of form application you want to create and then it creates a skeleton "working" form ready for you to customize. It does the hard part and leaves the easy, fun part for you.
The next step is an easy drag-and-drop operation. You choose fields, such as Entry fields, ListBox fields, and OptionButton fields, from the ToolBox window of EFD, add them to the window of your form, and position them as you want. Fields are the main
elements that make up a form. They are used to display information and get input.
Just about everything in EFD has properties (for example, Font size, Background color, and Window name) to set. There are properties specific to the form, properties specific for each window, and properties specific for each field. In most cases, you
should be able to use most of the default property settings that were initialized when you first created the object (form, window, or field). But you will need to change some properties to fit the requirements of your individual form. You use the Property
Inspector and the Field Appearance Palette to change most of the properties that need changing. The Property Inspector and Field Appearance Palette are discussed later in the sections, Property Inspector and The Field Appearance Palette.
After you have designed your form you'll want to install it into the Exchange Server so your organization can use it. You do this by selecting Install from the File menu or by clicking the Install toolbar button. Either action launches a four-step
process that results in the final form. (By the way, unless you are a programmer who wants to extend the form with custom programming, you probably won't care much about these steps; the important thing to know is that when these steps are completed, your
form will be installed and ready to use.)
That's the whole process from beginning to end. To summarize, you start by planning the form you want to design. You then use the EFD Forms Wizard to create a basic form to get you started. Next, you add fields and then set properties to customize the
form to fit your design needs. Finally, you instruct EFD to generate and install your form.
We are now going to take a close look at EFD and look at the tools and methods it provides to make designing forms easier.
This section takes you through a quick tour of the features and tools in EFD that you'll use to design forms.
There are several important windows in EFD that you will use while you design your form. This section lightly touches on each one to give you a feel for the overall structure of EFD.
The layout window is where you actually place the fields you want on your form. It represents a window of the final form itself, but at this point it has no functionality other than enabling you to place and position fields. Figure 27.2 shows the layout
window with some fields already on it.
FIGURE 27.2. The EFD layout window.
Note that there are several parts to the layout window. The canvas is where most of the design activity will take place. The canvas represents the body of your form. You choose fields from the toolbox and place them on the canvas. The
envelope area is where your envelope fields go. Envelope fields are the From, Date, To, Cc, Bcc, and Subject fields that appear in an e-mail message so the user can enter and/or read header information regarding the message and its recipient(s). The
menu, toolbar, and status bar on the canvas are non-functional, except that you can change the menu captions. These pieces are here mainly for cosmetic reasons to give you a feel for the final look of your form. Collectively, the
envelope area, menu, toolbar, and status bar are referred to as the header, distinguished from the canvas. As you'll see later, you can hide the header to give you more room for working on the canvas.
The menu bar, not to be confused with the non-functional menu on the layout window, includes a toolbar and is where you can process commands that affect the layout window and other windows. (See Figure 27.3.)
FIGURE 27.3. The menu bar.
The toolbox is where you select fields to place on the canvas. It has two parts. The top part contains buttons from which you choose envelope fields, and the bottom part is where you choose body fields to place on the canvas (see Figure 27.4).
FIGURE 27.4. The toolbox.
You place envelope fields on the canvas by clicking the button of the envelope field you want. Clicking it again removes the envelope field. You cannot position these fields; they can only be turned on and off. Envelope fields are often referred to as
header fields.
You add the body fields to the canvas by clicking the desired field in the toolbox and then clicking on the canvas. A field with default size is placed where you click the canvas. The individual fields are discussed shortly in the section The Body
Fields of EFD. Body fields are often referred to as canvas fields.
If you hold down the Ctrl key when you click the body field on the toolbox, that field becomes "sticky" and you can place several copies of this field on the canvas by repeatedly clicking on the canvas. Clicking anywhere outside the canvas or back on the toolbox causes this sticky mode to end and return to normal.
Each field you place on the layout window has several properties that you can customize. For example, you can change the caption, back color, size, and location of most fields. You also can set properties for each window that makes up your form, and for
the form itself. You set and view these properties using the property inspector (PI); it can be displayed from the View menu. There are three types of property inspectors; one for form properties (the Form PI), one for window properties (the Window PI),
and one for field properties (the Field PI). Only one can be shown at a time.
All three PIs are made up of tabbed dialog boxes and are described in the following sections.
You set and view properties for your overall form in the Form PI.
On the General tab of the Form PI, you can change properties such as the name of your form and the icons associated with it.
On the Events tab, you can specify or view the action that will take place or the window to show when the user performs certain events (for example, clicking the Reply or Print button). These settings are called the form's Events Properties.
Events Properties refers to a collection of properties that define how the form will react when certain events occur. For example, when Exchange tells you that a Print event occurred (for example, the user clicked the Print button on the toolbar), you will probably want to set the Print event's properties to print the active window. Figure 27.5 shows the General tab of the Form PI.
FIGURE 27.5. The Form PI showing the General tab.
You set properties specific to each window in your form in the Window PI. You'll probably want to provide different windows that the users see when they are, for example, composing a new form to send as opposed to reading a form they just received. EFD
enables you to create several windows for various purposes, and each has its own individual properties. Examples of window properties are the window caption, background color, and menu captions. Figure 27.6 shows the Menus tab of the Window PI.
FIGURE 27.6. The Window PI showing the Menus tab.
Each field you place on the canvas in turn has its own properties to set or view. If you click on different fields of the canvas while the Field PI is displayed, the Field PI changes to reflect the properties of the selected field. As you change field
types, the settings available also change to those appropriate for the selected field's type. For example, a CheckBox field will have a property setting for declaring whether the check box should be initially checked or unchecked; such a property wouldn't
make sense for an Entry field that shows only text. The CheckBox and Entry fields are described later in the sections The CheckBox Field and The Entry Field, respectively. Figure 27.7 shows the Format tab of the Field PI.
FIGURE 27.7. The Field PI showing the Format tab.
Not all field properties can be set by the PI (for example, 3-D and border properties can't be set using the PI). The Field Appearance Palette enables you to set the background and foreground colors of each field and modify their 3-D or flat appearance.
For example, you can show an entry field that has a very wide border with a raised 3-D look to give it special emphasis. Giving it red text on a green background might be just what you want for the company's Christmas forms. Figure 27.8 shows the Field
Appearance Palette. Note that the two rows of small boxes labeled Fore Color and Back Color each display a set of colors you can change for these properties.
FIGURE 27.8. The Field Appearance Palette.
There are ten different field types, plus variations of some of the types, which you can place on the canvas (body) part of the form. Figure 27.4, earlier in this chapter, shows which toolbox button creates each of these fields. Figure 27.9 shows an
example of each field, including some variations, after the field has been placed on the canvas. They will look different in the final runtime form (for example, the list box will probably be populated with items you specified in its properties), but their
sizes and positions will remain the same in most cases. Note that some fields, such as the ComboBox field, can take on different appearances depending on their properties. Also, some fields (the Frame, PictureBox, and Tab fields) are known as container
fields. A container field is a special type of field that can contain other fields. This is described in more detail in the section The Frame Field.
FIGURE 27.9. EFD field types.
The Label field is a simple field for displaying read-only text on the canvas. The text will word-wrap if there is more text than will fit within the width of the field.
The Entry field is a field in which the user can enter text. You will often use the Entry field when you want to require the user to enter formatted data, such as dates, currency, or numbers. You can also use it for entering plain text, but the
RichEntry field (described next) is better suited for this purpose.
You also use the RichEntry field to enter text, but unlike the Entry field, the user can change the font, color, size, and so on of individual characters within the field at runtime; text that can be changed like this is commonly referred to as rich
text. You can also embed OLE objects, such as Excel spreadsheets, within the body of the RichEntry field at runtime. Note that at design time, the Entry field and RichEntry field appear identical. For this reason, only one is shown in Figure 27.9.
The CheckBox field enables you to prompt the reader for simple yes/no type of input. It's a great field to use for surveys.
The OptionButton field is also commonly used in surveys. Option buttons, unlike check boxes, operate together in groups. When you place an option button on the canvas, it is automatically contained within a Frame field (see The Frame Field, later in
this chapter). The OptionButton field cannot exist outside a Frame field. If you try to move it out of the Frame field and place it directly on the canvas, another Frame field will automatically be created to contain it. You can place multiple OptionButton
fields within the same Frame field, and that is exactly what you want to do. When you have multiple option buttons within the same Frame field only one can be selected at a time. Whenever you select another option button, the one currently selected becomes
unselected.
If you want to make the option buttons appear as if they are not within a frame, you can set the properties of the containing frame to have no border or caption and a background color that matches the background color of the canvas (or the frame's container). This gives the appearance that the frame is invisible. The option buttons are still in a frame, but the frame appears invisible. To do this, follow these steps:
- Place your option button on the canvas.
- Display the Field Appearance Palette (Ctrl+A).
- Select the first option button labeled None to make the option button non-3-D.
- Select the Frame field that contains the new OptionButton field.
- Change the Frame Style to Panel in the Field PI's Format tab.
- Display the Field Appearance Palette while the Frame field is still selected.
- Click the blank button on the far right in the row of buttons labeled Width (refer to Figure 27.8).
Your Frame field's background color will change to match the background color of the canvas (or container). If you later change the background color of the canvas (or container), the background color of the frame will also change to match, thus keeping it virtually invisible. It will not appear invisible, though, if you put a picture behind it.
The ComboBox field gives you a field that can contain a list of items from which the user can select and/or enter his or her own new item. Note that when the user enters a new item, it is not added to the list, but it does remain in the entry part of
the ComboBox. Whatever item the user selects or adds is displayed as the active item to the recipient of the form.
When first dropped on the canvas, the ComboBox has the Dropdown ComboBox style. You can change it, though, to a Standard List or Dropdown List field by changing its style property in the Field PI. The list box and drop-down list box styles enable you to
add items to their respective lists at design time, but at runtime the users cannot type in their own choices as they can with the ComboBox style. Again, the selected item in the list remains the selected item when the recipient receives the form. Each
style of the ComboBox field can be seen in Figure 27.9.
The ListBox field is exactly the same as the ComboBox field except that when it is dropped on the canvas it is initialized with the ListBox style instead of the ComboBox style. See The ComboBox Field earlier for more information.
The Frame field is the first of the container fields. Container fields are fields in which you can place other fields. For example, Figure 27.9 shows a frame field containing two OptionButton fields, a CheckBox field, an Entry field, and a
PictureBox field (described later in the section The PictureBox Field). These fields aren't merely positioned in front of the Frame field, they are actually contained by it. If you reposition the Frame field, all of its contained fields will move along
with it.
The Frame field can take on one of two styles, Standard and Panel, when you set its Frame Style property in the Field PI. In Figure 27.9, the frame on the right is the Standard style. To the left of the Standard style Frame field is a Panel style Frame
field containing the three styles of the ComboBox (or ListBox) field. You can change the look of the Panel style to be either raised or inset 3-D, or you can make it appear invisible by giving it no border at all using the Field Appearance Palette. When
you remove the border from the Panel style, it takes on a new feature; its background color will now always match the background color of either its container or the canvas if it's not in another container.
Note that container fields can be contained within other container fields. This is called nesting.
Nesting means that you place a field within another field. It is said that one field is nested within the other. Only container fields can nest other fields. Sometimes, the container field is referred to as the Parent and the nested field is referred to as the Child.
When there is not enough room on the canvas to hold all the fields you need for your form, or you want to organize the fields on your form into logical groupings, the Tab field comes to the rescue. Like the Frame field, the Tab field is a container
field, but with multiple containers. Only one container can be seen at a time, but you can easily switch from one to the other by clicking the tabs at the top of the field. By setting properties in the PI, you can change the number of tabs in your Tab
field. You can change the captions of the individual tabs by clicking the selected tab's caption and typing in a new one.
You can have only one Tab field per window of your form.
The PictureBox field enables you to display a bitmap, icon, or metafile on your form. By setting properties in the Field PI, you can configure the PictureBox field to automatically size itself to the size of the picture or to stretch the picture to fit
the size of the control. Like the Frame and Tab fields, the PictureBox field is also a container field in which you can nest other fields.
The Form Template Wizard is similar to other wizards you might have used with other software applications. By answering the Wizard's questions, you can create a template in which the number of windows, default envelope fields, form types, and form event
properties are already defined. You then add fields and customize the properties for your fields, windows, and the form.
There are two basic form types created by EFD's Wizard: forms to send information and forms to post information. As the names imply, a Send form is used to send information from point A to point B, and a Post form is used to post
information in a specific location (most commonly in a public folder). See Figure 27.10 for an example of the Form Template Wizard.
FIGURE 27.10. The "Where will your information go?" screen of the Wizard.
These two basic form types each fall into two categories: a Send category and a Reply category. Send and Post forms used for sending information are very straightforward to design and use. Send and Post Reply forms, though, are a bit more complicated,
because to use them you must integrate them with another formthat is, the form to which you are replying. You must modify the other form's event properties to make this connection. The primary difference between the Send and Reply forms is the types
and handling of envelope fields. A Reply form will automatically initialize some of its envelope fields. For example, it will automatically address the reply to the sender of the original message. A Send form's envelope fields will automatically be blank.
(Note that you can change any of the settings using the Field and Form Property Inspectorsthe settings discussed here refer to Wizard default settings.) Figure 27.11 shows the Wizard screen where you tell EFD whether your form will be used to send a
new message or send a response.
FIGURE 27.11. The "How will your Send form be used?" screen of the Wizard.
After you become familiar with using EFD and setting form properties, Reply forms will not seem as complex. For more information on using Reply forms, refer to the Application Designer's Guide or EFD's on-line help.
The Form Template Wizard can create a one-window form or a two-window form for both the Send and Post forms. With a one-window form you get a single window that is used for both composing and reading a note. With a two-window form you get separate
windows for composing and reading. You use the Compose window to compose the information to be sent or posted. You use the Read window to view the information after it has been sent or posted. The Read window also has additional fields (such as From) that
are initialized with information from the Compose window. Figure 27.12 shows the Wizard screen in which you specify whether you want a one-window or a two-window form.
FIGURE 27.12. The Wizard screen that asks, "Do you want one window or two windows in your form?"
If you ask the Wizard for a form with two windows, the Wizard will create windows named Compose and Read, respectively.
If you ask for a one-window form, it will be named simply Window1. Again, the same window is used for both composing and reading.
There are several occasions on which a two-window form is advantageous, if not necessary. For example, the Expense Report form (which you will design later in this chapter) has a specific need for two windows. You need to allow the employee to enter
expense items in the form, but you must not allow the employee's manager to alter it. To meet this need, use two windows; in the Compose window, all fields on the form can be written to, but in the Read window, the window read by the manager, the expense
item fields have been "locked" from use (made read-only). This easily shows the same information to both users without allowing the manager to modify the pertinent data.
Another occasion on which a two-window form would be appropriate is for an information-gathering form used over and over by a specific department. For example, perhaps your Human Resources department sends out a form to every new employee requesting
routine data such as his or her name, address, phone number, and so on. The Compose window might need only the To: and Subject: envelope fields. The Read window, though, would look like a standard data entry form, with field names and places for the
employee to type in the required data. Rather than show all the empty data fields to Human Resources over and over, you can simply show them a small form with To: and Subject: fields.
Any time your form's composer and your form's reader don't need to see the same information, a two-window form might be in order.
To summarize, depending on your answers to the Wizard's questions, the Wizard will produce one of the following eight types of forms:
As the last part of the quick tour of EFD, make a simple form and install it. You'll make a simple Send note, similar to the standard message window in which you currently compose mail with Exchange. This will simply be a form with the standard envelope
fields and a RichEntry field. The following are the steps you should take:
FIGURE 27.13. Placing the RichEntry field onto the canvas.
FIGURE 27.14. The RichEntry field moved to the upper-left corner of the canvas.
FIGURE 27.15. The Set Library To dialog box.
FIGURE 27.16. The New Form dialog box.
In a moment, your runtime form should appear. Notice that the RichEntry field (the Body field) you added to the form now fills up the entire canvas. This is the result of checking the Auto-size to window bottom property. Notice how much Figure 27.17
looks like the standard e-mail note shown in Figure 27.1.
FIGURE 27.17. The runtime form showing the RichEntry field filling the canvas.
Enter some text in the body field (because it's a RichText field, try using various font styles, sizes, colors, and so on) and send the form to yourself. Open it up when it appears in your inbox.
That completes the quick tour of EFD. Without going into great detail you have seen all the elements for designing forms with the Microsoft Exchange Forms Designer. You are now ready to jump in and build a more complex form, the Expense Report form,
which should be useful within your organization.
The form you just created does not enable you to insert files into the body of the message. You can add this capability easily in EFD by going to the Field PI's General tab (when the RichEntry field is selected on the canvas) and selecting MAPI_Body_Custom from the Reference Name drop-down list box. That's all you need to do. When you reinstall the form (see the following tip) it will now enable you to insert files into the body field.
In this section you will design, install, and integrate three forms that will work together as an expense report Exchange application. Your objective is to create a method for employees to create expense reports electronically and submit them to their
managers for approval. The managers will need the capability to either approve the expense reports for payment and forward them to another department for processing or to decline approval and return the expense report to the employee with comments
explaining why the report was declined. To implement this, you will design and build the following three forms:
FIGURE 27.18. The Compose window of the Expense Report form.
FIGURE 27.19. The Read window of the expense report form.
FIGURE 27.20. The Approve form's window.
FIGURE 27.21. The Compose window for the Decline form.
FIGURE 27.22. The Read window for the Decline form showing the Comments tab with comments thread.
You design these three forms entirely within the EFD environmentthere will be no programming required. Later, you'll add a custom feature to the form to learn how to make programming changes to the form if you want.
First, you will build the three forms one at a time, and then integrate them. In the following sections you will find a major section for each form that is broken down into steps for you to follow.
The Expense Report form is the form in which the employee will enter expenses. First you'll build the form, and then you'll install it. You'll then test the runtime form to verify that it works properly on its own before you proceed with building the
other two forms.
As you learned earlier, when you build a form with EFD, you will do the following:
Start EFD. In the opening window, select Form Template Wizard, and then click Next. Continue through the Wizard and answer its questions according to Table 27.1.
| When asked this: | Choose this, and then click Next |
| Where will your information go? | To another user (Send) |
| How will your Send form be used? | To Send information |
| Do you want one window or two windows in your form? | Two windows |
The Wizard will now prompt you for a form name and description. Enter Expense Report as the form name. Enter Expense Report Form as the form description.
The Form Display Name represents how your form will be identified to the users of Exchange. After your form is installed in the Organization Forms Library, the form name will be visible in the New Form dialog box whenever a user selects New Form from the Exchange Viewer's Compose menu.
The Description tells the users about your form. It is also visible in the New Form dialog box and other places in Exchange. It is good practice to include a short but clear description of your form's purpose in its Description field so that users can easily tell from the New Form dialog box what your form can do for them.
Click Next, and then click Finish. The Wizard will now create and display the form you requested.
Before proceeding, save your work. From EFD's File menu, select Save. In the Save As dialog box, enter EXPENSE.EFP as the filename. Click OK. Your form is now saved as ...\EFDFORMS\EXPENSE.EFP.
To design the Compose window, you will go through the steps described in the following sections:
Using the method discussed earlier in the General Usage section, add the fields shown in Table 27.2 to the canvas in the following order: start with the Tab field, and place the remaining fields inside of Tab 1 of the Tab field (make sure that Tab 1 is
the current tab page). After all the fields have been added to the canvas, put them in the proper position by setting their properties in the Field PI.
| Field Name | Number of Fields |
| Tab field | 1 |
| Label field | 5 |
| Entry field | 21 |
| ComboBox field | 5 |
The next step is to set the field's properties. To set a field's properties, you must first select the field. Because there are a large number of fields in this window of the form, it will be difficult to select a field by clicking on it as you did
before. Instead, select the field in the Fields drop-down list box (located at the far right side of EFD's menu window). After the field is selected, the Field PI will show its properties so you can change them.
The following list shows the fields whose properties need setting and the order in which we will proceed.
Select the Tab field, and then press F4 to load the Field PI (or select Field Properties from the View menu). By default, the General properties tab of the Field PI is loaded. Set the General properties shown in Table 27.3 for the Tab field. If Table
27.3 does not specify a property setting, leave the default setting alone.
| General Property | Value |
| Left | 75 |
| Top | 90 |
| Width | 8670 |
| Height | 2820 |
Instead of setting the Left, Top, Width, and Height properties in the PI you could instead drag the field to its location with your mouse. Entering the property values in the PI, though, allows for better precision, so use this method to build the expense report.
Click the Format tab on the Field PI. The expense report form uses only two tabs, so you need to remove Tab 3 and Tab 4 from the Tab field. Locate the Pages list (in the middle of the Format tab of the Field PI). Select Tab 3 and click the Remove
button. Repeat the process for Tab 4. This should leave only Tab 1 and Tab 2.
Set the Format properties shown in Table 27.4 for the Tab field. If Table 27.4 does not specify a property setting, leave the default setting alone.
| Format Property | Value |
| Tabs per row | 2 |
| Tab 1 caption | Ex&penses |
| Tab 2 caption | Comme&nts |
For detailed information on any of the available field properties, select the property and press F1 to display EFD's online help, or refer to the Application Designer's Guide.
To change the tab captions, double-click the tab name in the Pages field of the Format tab. A dialog box in which you can change the caption will appear. Alternatively, you can edit the caption directly in-place on the tab itself by moving the mouse
cursor over the tab and clicking it when the mouse cursor changes to an I-beam.
Notice that the ampersand (&) character becomes an underline of the following character when you accept your entry. The underlined character is now a hot key, which enables the user to reach either tab page simply by pressing Alt+P (to reach the Expenses tab page) or Alt+N (to reach the Comments tab page).
Label fields for the column headings
Now you set the properties for the Label fields. You will use the Label fields for the column headings in the expense report. Start by selecting Label1; this will be the heading for the column in which the employee enters the date of the expense. Note
that when you select Label1, the Field PI automatically updates to display its properties. Click the General tab of the Field PI. Set the General properties for Label1 as shown in Table 27.5.
| Property | Value |
| Reference Name | LabelDate |
| Left | 60 |
| Top | 35 |
| Width | 1200 |
| Height | 300 |
The reference name is just a name you give to the field that identifies it to you later. You could leave it with its default name, but it will make your design easier if you give it a meaningful name. Later you will be copying information from fields in one form to fields in another form; you will use the reference name to identify the fields you are copying from and to.
Click the Initial Value tab of the Field PI and enter the following in the Initial Text field:
Date (m/d/yy)
This will be the text of the heading for the date column.
Set field properties for Label2 through Label5. Go back to the General tab of the Field PI, and for each field use the same values as those used for Label1, substituting the Reference Name and Left values as shown in Table 27.6. (Remember, to select a
field, choose it from the drop-down list box on the right side of EFD's menu bar.)
| Label Number | Property/Value |
| Label2 | Reference Name = LabelDescription |
| Left = 1290 | |
| Label3 | Reference Name = LabelCategory |
| Left = 3720 | |
| Label4 | Reference Name = LabelAccountNo |
| Left = 6045 | |
| Label5 | Reference Name = LabelAmount |
| Left = 7275 |
Click the Initial Value tab of the Field PI. Enter Initial Text for Label2 through Label5 as shown in Table 27.7. Recall that these will be the column headings for the expense report.
| Label Reference Name | Initial Text |
| LabelDescription | Description |
| LabelCategory | Category |
| LabelAccountNo | Account No. |
| LabelAmount | Amount |
Entry fields for the date column
Users will enter the date of the expense in the date column. For example, 1/1/96.
Locate Entry1 in the Fields drop-down list box on EFD's menu bar. Set General properties for Entry1 as shown in Table 27.8.
| General Tab Property | Value |
| Reference Name | Date1 |
| Left | 60 |
| Top | 335 |
| Width | 1200 |
| Height | 300 |
You also need to set properties for Field Help. Click the Field Help button on the General tab of the Field PI to display the Field Help for Users dialog box. In the Status Bar field, enter the following:
Enter the expense date in the following format: m/d/yy.
Field Help is displayed when the user of the runtime form presses F1 from within a field. Instructions on what type of information goes in a field and how to enter it can be put into Field Help. When you enter status bar text for your fields, the text is visible on the runtime form's status bar whenever the field has focus.
Set field Format properties for Entry1 as shown in Table 27.9.
| Format Tab Property | Value |
| Type | Date |
| Format | System Default (Short) |
The Type and Format properties are available for the Entry and Label fields. These properties control what kind of data can be used by the field. There are six different types: Text, Integer, Date, Time, Currency, and Floating Point. For each type except Text there are several predefined formats from which you can select. The Text field type enables you to enter any kind of data. The Date field, like that used here, enables the user to enter only dates. If the field contains data that does not correspond with its Type/Format properties, Exchange will not enable the message to be sent until the data is corrected.
Some Format properties are available only for the field itself, and not for the field's caption. You control which properties are visible by selecting Field or Caption at the top of the Format tab.
Set field properties for Entry2 through Entry5. For each field, use the same values as those used for Entry1, substituting the Reference Name and Top values as shown in Table 27.10.
| Field Number | Property/Value |
| Entry2 | Reference Name = Date2 |
| Top = 665 | |
| Entry3 | Reference Name = Date3 |
| Top = 995 | |
| Entry4 | Reference Name = Date4 |
| Top = 1325 | |
| Entry5 | Reference Name = Date5 |
| Top = 1655 |
Entry fields for the Description column
In the Description column the user will be able to enter a brief description of the expense. For example, "Lunch meeting with Sam to discuss budget issues."
Set the properties for Entry6 as shown in Table 27.11.
| General Property | Value |
| Reference Name | Description1 |
| Left | 1290 |
| Top | 335 |
| Width | 2400 |
| Height | 300 |
| Status Bar | Enter a brief description of the expense item. |
| Field HelpQuickHelp caption | Description |
| Field HelpQuickHelp body text | Enter a brief description of the expense item. Example: Lunch meeting with Sam to discuss budget issues. |
Remember, to set Field Help properties, you must first click the Field Help button on the General tab of the Field PI.
Set field properties for Entry7 through Entry10. For each field, use the same values as those used for Entry6, substituting the Reference Name and Top values as shown in Table 27.12.
| Field Number | Property/Value |
| Entry7 | Reference Name = Description2 |
| Top = 665 | |
| Entry8 | Reference Name = Description3 |
| Top = 995 | |
| Entry9 | Reference Name = Description4 |
| Top = 1325 | |
| Entry10 | Reference Name = Description5 |
| Top = 1655 |
ComboBox fields for the Category column
Expenses generally fall into categories such as Meals and Lodging. The Category column is where the user will select under which category each expense belongs. At times, an expense will not fit into one of the predefined categories and the user will
need to enter a new category. The ComboBox field is perfect for this type of situation, so for this exercise use ComboBox fields for the Category column.
Set properties for ComboBox1 as shown in Table 27.13.
| General Property | Value |
| Reference Name | Category1 |
| Left | 3720 |
| Top | 335 |
| Width | 2295 |
| Field HelpStatus Bar | Select an expense category from the list. |
| Field HelpQuickHelp caption | Category |
| Field HelpQuickHelp body text | Select an expense category from the list. To see the list of available choices, click on the arrow located at the right-hand side of the Category field. |
Note that you did not set the Height property for ComboBox1. This is because ComboBox fields have a fixed size.
Set field Initial Value properties for ComboBox1 as shown in Table 27.14.
| Initial Value Tab Property | Value |
| List values | Entertainment |
| Food | |
| Lodging | |
| Office Supplies | |
| Other | |
| Telephone | |
| Training | |
| Travel |
Initial Value properties set and display the initial entry contained in the field when the form is first displayed at runtime. In the case of the Category combo box, you are setting the initial value to the different available expense categories. Other fields also have initial value properties. For example, you use the Initial Value tab to give an entry field an initial value that the user can type over if they choose to.
Set field properties for ComboBox2 through ComboBox5. For each field, use the same values as those used for ComboBox1, including the Initial Value properties, substituting the Reference Name and Top values as shown in Table 27.15.
| Field Number | Property/Value |
| ComboBox2 | Reference Name = Category2 |
| Top = 665 | |
| ComboBox3 | Reference Name = Category3 |
| Top = 995 | |
| ComboBox4 | Reference Name = Category4 |
| Top = 1325 | |
| ComboBox5 | Reference Name = Category5 |
| Top = 1655 |
Entry fields for the Account No. column
You might want to have an account number for the employee's use in entering their expense item. For example, 001 could be food, 002 could be supplies, and so on.
Set properties for the Entry11 field as shown in Table 27.16.
| General Property | Value |
| Reference Name | AccountNo1 |
| Left | 6045 |
| Top | 335 |
| Width | 1200 |
| Height | 300 |
| Field HelpStatus Bar | Enter the expense account number. |
| Field HelpNo Help | Selected |
| Format tab Property | Value |
| Type | Integer |
| Format | 0 |
Set field properties for Entry12 through Entry15. For each field, use the same values as those used for Entry11, substituting the Reference Name and Top values as shown in Table 27.17.
| Field Number | Property/Value |
| Entry12 | Reference Name = AccountNo2 |
| Top = 665 | |
| Entry13 | Reference Name = AccountNo3 |
| Top = 995 | |
| Entry14 | Reference Name = AccountNo4 |
| Top = 1325 | |
| Entry15 | Reference Name = AccountNo5 |
| Top = 1655 |
Entry fields for the Amount column
Employees will need to enter the amount of each expense item in the amount column.
Set properties for Entry16 as shown in Table 27.18.
| General Property | Value |
| Reference Name | Amount1 |
| Left | 7275 |
| Top | 335 |
| Width | 1200 |
| Height | 300 |
| Field HelpStatus Bar | Enter the expense amount in dollars and cents (for example, 10.95). |
| Field HelpNo Help | Selected |
| Format Tab Property | Value |
| Type | Currency |
| Format | General |
Set field properties for Entry17 through Entry20. For each field, use the same values as those used for Entry16, substituting the Reference Name and Top values as shown in Table 27.19.
| Field Number | Property/Value |
| Entry17 | Reference Name = Amount2 |
| Top = 665 | |
| Entry18 | Reference Name = Amount3 |
| Top = 995 | |
| Entry19 | Reference Name = Amount4 |
| Top = 1325 | |
| Entry20 | Reference Name = Amount25 |
| Top = 1655 |
The employee enters in the Total field the total of all amounts in the Amount column.
Set properties for Entry21 as shown in Table 27.20.
| General Property | Value |
| Reference Name | Total |
| Left | 7275 |
| Top | 1985 |
| Width | 1200 |
| Height | 300 |
| Required | Checked |
| Field Caption | Tota&l |
| Field HelpStatus Bar | Total the Amount column and enter the sum here. |
| Field HelpNo Help | Selected |
| Format Tab Property | Value |
| Type | Currency |
| Format | General |
Required is a property that specifies that the user must enter something. He or she won't be able to send the form without doing so. In this case, you are specifying that the user must total his or her expense report before sending it. How many times have you turned in an expense report without a total and had the form sent back to you without payment because of the missing total?
The Expense Report tab page is now complete.
Click on the Comments tab page, and then use the toolbar to add a RichEntry field to the Comments tab. This field will give the form's users a place in which to enter their comments.
Set field properties for the RichEntry field as shown in Table 27.21.
| General Property | Value |
| Reference Name | MAPI_Body_Custom (set this by selecting it in the Reference Name list box by clicking on the arrow at the right side of the field) |
| Left | 45 |
| Top | 30 |
| Width | 8475 |
| Height | 2310 |
| Field CaptionPosition | None |
| Field HelpStatus Bar | Use this field to add your comments. |
| Field HelpNo Help | Selected |
| Format Tab property | Value |
| Vertical Scroll Bar | Checked |
Recall that MAPI_Body_Custom is a special reference name available only for the RichEntry field that, when set, enables the user to attach files to the field in the runtime form. To learn more about the MAPI_Body_Custom field, put the focus in the Reference Name field of the Field PI and press F1.
You are now finished setting field properties for the Compose window. From EFD's File menu, select Save to save your changes before proceeding.
After you become more familiar with using EFD, you might find it easier to use the Clipboard to copy and paste similar fields when you are adding several fields of the same type. For example, you could have copied the first row of entry fields (Date1 through Amount1) to the Clipboard, and then pasted four copies onto the Expense Report tab to make the other four rows. Most of the properties will be copied with the fields, but you will still have to reposition the fields and enter a new Reference Name for each one.
To set Window properties, display the Window PI by pressing Ctrl+W (or select Window Properties from the View menu). By default, the General properties tab of the Window PI is loaded. Set the Compose window's General properties as shown in Table 27.22.
If Table 27.22 does not specify a property setting, leave the default setting alone.
| Property | Value |
| Window Name | Compose |
| Window Caption | Create Expense Report |
| Field Tab Order | (see Setting Field Tab Order on the General Tab, later in the chapter) |
| Window Helpcaption | Expense Report |
| Window Helpbody field | Use this form to prepare an expense report for manager's review. |
The Window Name identifies the window to EFD and to Exchange. EFD uses the Window Name for setting the form's Events properties (discussed later in this chapter under Set the Form's Events Properties) to the correct window. Exchange uses the Window Name to determine which window the Exchange client will display at runtime.
The Window Caption will be displayed as the runtime form's caption to users who are creating an expense report (they will be viewing the Compose window of the form).
Setting Window Help properties enables you to display instructions to the runtime user on how to use the current window of the form.
Setting Field Tab Order on the General tab
The Field Tab Order section of the Window PI enables you to add your fields to the form's tab order (the order in which the cursor moves through fields each time you press the Tab key). By default, EFD always includes the envelope fields (that is, the
To and Subject fields) first in the form's tab order. Generally, the envelope fields should always remain at the top of the window's tab order. To add a field from the Available Fields list to the Fields in Tab Order list, first click the field you want to
add in the left column, and then click the (>>) button to move the field to the right column (it will be placed after the field currently selected in the right column). Finally, use the Up and Down arrows to position the field in the proper order,
the top field being number one in the tab order.
Add the Compose window's fields to the form's Tab Order in the following order:
Setting properties on the Format tab
To set properties on the Format tab, click the Format tab of the Window PI. Set Format properties for the Compose window as shown in Table 27.23.
| Property | Value |
| Maximize Button | Checked |
| Minimize Button | Checked |
| Toolbar | Checked |
| Status Bar | Checked |
| Formatting Toolbar | Checked |
| Window Icon | C:\EXCHANGE\EFDFORMS\ICONS\NOTE2L.ICO |
| Window Sizing Options | Fixed Size |
The minimize and maximize properties control whether your runtime form can be minimized or maximized. Note that maximizing a runtime form does not have any effect on the size or location the form's fieldskeep this in mind when you are deciding whether to include a maximize button on your form. If the form is minimized, the Window icon will be the visible representation of your form on the user's desktop.
The toolbar properties control whether your runtime form will display the specified toolbars. Typically, forms should always have a toolbar. You use the Formatting toolbar to format the contents of the RichEntry field. The status bar displays status-bar text for fields and menu command items.
EFD uses the Window icon to represent the minimized window on the user's desktop (note that the path specified in Table 27.23 assumes you installed EFD in the default location; if you installed it elsewhere, you will need to modify this property setting accordingly).
You use the Background property to control the background color of the window.
The Window Sizing Options control whether your window can be sized with the mouse (by using the mouse to drag the window borders to a desired size). This property is separate from the Maximize and Minimize properties (that is, a Fixed Size window can still be maximized or minimized if these properties are checked in the Format page of the Window PI).
Congratulations! You've just finished the toughest part of the Expense Report Exchange Application. From EFD's File menu, select Save to save your changes before proceeding.
You are now ready to design the Read window.
From EFD's Window menu, select Read. EFD will load the Expense Report form's Read window. The Read window will be seen by recipients of the expense report (when an employee sends an expense report to his or her manager for approval, the manager will see
the form's Read window when he or she opens the item in his or her Exchange inbox).
The Read window is going to look just like the Compose window, except that most of the fields will be locked (read-only). Because the Read and Compose windows are so similar, make things easy by copying the fields from the Compose window using EFD's
Insert Fields feature.
Because you used the Insert Fields feature, most of the field properties are already set appropriately for the Read window. However, you will need to do the following:
Click on the Tab field and press F4 to load the Field PI. In the General tab of the Field PI, set the tab's Left property to 75, and the Top property to 90.
After the employee completes and sends his or her expense report, you (the form designer) need to make the form do the right thing with the employee's information. In this case, you need to make sure that the expense report items cannot be modified
after the employee has sent the form. You can do this by setting a single property for every Entry field and ComboBox field on the Read window (Date1 through Date5, Description1 through Description5, Category1 through Category5, AccountNo1 through
AccountNo5, Amount1 through Amount5, and Total). Each of these fields on the Read window must be set to Locked (read-only). This will ensure that the employee's expense items cannot be modified after the employee sends the form. Go ahead now and set the
Locked property for these fields. You'll find it on the General tab of the Field PI.
Now that the Entry and ComboBox fields are locked, you need to modify the help text. Because the viewer of the Read window cannot make entries to these fields, change their help text to describe what the field contains (for example, change "Enter
the date of the expense item" to something like "Displays the date of the expense item"). Go ahead now and modify the help text for each of the fields on the Expense Report tab page. Recall that you set the Field Help properties by clicking
the Field Help button on the Field PI's General tab.
The Comments tab and its contained field (the MAPI_Body_Custom RichEntry field) require no changes. The manager will be allowed to enter comments into this field, just as the employee can.
You should set the Read window's Window properties identical to those for the Compose window, with two exceptions: the window Name should be Read and the window Caption should be changed to Read Expense Report. Refer to Table 27.22 and 27.23 to set the
Read window's remaining properties. Go ahead and set these properties now.
You are finished setting the Read window's properties. From EFD's File menu, select Save to save your changes before proceeding.
The last thing you need to do before this form is finished is set the Form properties themselves. There are two types of properties you will be setting:
To set the form's General properties, display the Form PI by pressing Ctrl+F (or select Form Properties from the View menu). By default, the General properties tab of the Form PI is loaded. Notice that the form name and description you entered when you
first started with the Wizard are displayed in the Form PI.
Enter values for the rest of the form's General properties as specified in Table 27.24.
| Property | Value |
| Version | 1.00 |
| Item Type | IPM.Send.ExpenseReport |
| Large Icon | C:\EXCHANGE\EFDFORMS\ICONS\NOTE2L.ICO |
| Small Icon | C:\EXCHANGE\EFDFORMS\ICONS\NOTE2S.ICO |
| Form HelpCaption | Expense Report |
| Form Helpbody text | Use this form to send an Expense Report to your manager for approval. |
Use the Version property to track changes to your .EFP file. When you add new features or revise existing ones, update your Version property accordingly. (Usually, if you make minor modifications to an existing form design, the Version number will become 1.1. If you make major modifications, or if you redesign the form, the Version number will become 2.0.)
Exchange uses the form's Item Type to locate the form in the Forms Library. For example, when you ask Exchange to load the Expense Report form later in this chapter in the section Test the Form, Exchange will search through the Forms Library for a form with the item type IPM.Send.ExpenseReport (the Expense Report form's item type) It is very important that this item type be unique to all other forms that might be used in your system. You don't need to enter a value here if you prefer not to. EFD automatically generates one for you that is guaranteed to be unique. The advantage to creating your own is you can give it a name that is meaningful and easier to refer to. Later, when you integrate the three forms, you will use the item type to identify each one.
The form's large and small icons are visible to the user in different Exchange locations. The large icon is displayed in various Exchange dialog boxes, such as the New Form dialog box and the Forms Manager dialog box. The small icon is visible in the Item Type column in the Exchange Viewer. Several pairs of matched large and small icons are shipped with EFD, and they reside in the C:\EXCHANGE\EFDFORMS\ICONS directory, but you can use any ic