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 organization—a 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 items—similar 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.)
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).
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.
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 form—that 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 Inspectors—the 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.14. The RichEntry field moved to the upper-left corner of the canvas.
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.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 environment—there 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 Help—QuickHelp caption | Description |
Field Help—QuickHelp 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 Help—Status Bar | Select an expense category from the list. |
Field Help—QuickHelp caption | Category |
Field Help—QuickHelp 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 Help—Status Bar | Enter the expense account number. |
Field Help—No 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 Help—Status Bar | Enter the expense amount in dollars and cents (for example, 10.95). |
Field Help—No 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 Help—Status Bar | Total the Amount column and enter the sum here. |
Field Help—No 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 Caption—Position | None |
Field Help—Status Bar | Use this field to add your comments. |
Field Help—No 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 Help—caption | Expense Report |
Window Help—body 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 fields—keep 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 Help—Caption | Expense Report |
Form Help—body 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 icons you want to with your forms. Note that the small icon consists of approximately the upper-left 16x16 pixels of a regular icon. Anything beyond this area in the small icon property will not be visible in the Viewer.
Use Form Help to tell the user about your form. Forms can also work with external help files. For specific instructions on implementing Form Help, refer to the Application Designer's Guide or EFD's online help.
You will use the Expense Report form's Events properties to integrate the form with the Approve and Decline forms, which you will design later in this chapter in the sections The Approve Form and The Decline Form. Wait until then to set these
properties.
All of the functions that users can perform with a form are events. Examples are Printing, Saving, Replying, and Forwarding. Notice that these are some of the same items that appear in the form's Compose menu and File menu. You use the Compose menu to create new messages and to respond to messages you receive. The Events properties are probably the most complex properties of forms, and will typically be modified only by advanced users of EFD. Note that the Wizard automatically sets the Events properties of each form it creates. When you design the Decline Form later in this chapter, you will be shown exactly how to set the form's Events properties so that Exchange will know when to display each of the form's windows to the user.
For more detailed information on setting form Events properties, click the Help button on the Form Properties dialog box, or refer to the Application Designer's Guide.
Before you can use the form in Exchange, you need to create a runtime version of the form. You do this by "installing" the form into Exchange.
Select Install from EFD's File menu. EFD will now generate VB source code, create an executable file (.EXE) for your form, and install the .EXE into Exchange. At the end of this process, you will be prompted to select the forms library into which you
want to install the form. For now, select Personal Forms, and click OK. (Later, after the application is complete and tested, you'll move it into the Organization Forms Library.)
After you install your form into a Forms library, you should test it to verify that it behaves as you intended before making it available to Exchange users. A good practice to follow is to install your form into your Personal Forms library and test the form's behavior locally (send the form to yourself and use it as you expect users to). After you have verified that it is ready for general use, copy the form to the Organization Forms library.
The Form Properties dialog box will appear next; enter yourself as the contact name (the name of the person who should be contacted with questions about the form). Note that all the other properties were set during the design process. Click OK to
complete the installation of the expense report form into your Personal Forms library.
Your first form is complete. Test it now and verify that it works as expected.
From the Exchange Compose menu, select New Form. In the New Form dialog box, locate Expense Report in your Personal Forms library. Select the form and click OK. When the form is loaded, try using the form as you would expect users to, and verify that
all the fields function as intended. Verify the status bar text for the different fields by putting focus on the field and observing the status bar of the form. Try sending the form without totaling the items. The form should not enable you to send without
completing the Total field. Verify that you can enter data in all of the fields of the Compose window. Send the form to yourself and verify that you can see all of the information in the Read window. Verify that you cannot modify the Expense Report items
in the Read window. Verify that you can enter comments in both the Compose window and the Read window.
If you find errors, go back to EFD and make the necessary corrections. Then choose Install from EFD's File menu, and repeat the code generation and form installation process. Re-test to verify that any problems were corrected.
When a manager receives an expense report, he or she will either approve it for payment and forward the report for processing or decline approval and return the report to the employee for correction. In order to preserve the employee's original
information and transfer it from the Expense Report form to the Approve form, use the fields you've already created in the Expense Report form to build the Approve form.
An important difference between the Approve form and the Expense Report form is that the Approve form will have only one window. It has only one window because after the expense report is approved, nothing changes from what the manager sees and what the
Accounting department sees. Recall that you use two windows if the form's sender and the form's recipient need to see different information (for example, in the case of the Expense Report form, the expense item fields are locked in the Read window, but not
in the Compose window); in this case they are seeing the same information (the fields are locked for both the sender and the recipient), therefore you need only one window.
To build the form, you will do the following:
Use the Wizard and answer its questions according to Table 27.25.
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? | One window |
Enter Approve Expense Report as the form name, and enter Form for approving Expense Report as the form description. Click Next, and then click Finish. The Wizard will now create and display the form.
Now save your form as APPROVE.EFP.
To design the window, you will do the following:
To insert the Tab field from the Expense Report form's Read window, you will again (as you did for the Expense Report form's Read window) copy the fields you have already created using the Insert Field feature. You are inserting the fields from the Read
window because these fields have already been set to locked, which is what you want for the Approve form.
Follow these instructions to insert the fields:
Position the Tab field by setting its Left property to 75, and its Top property to 420.
Next, add a Label field directly to the canvas (not to the Tab field, as you did for the Expense Report form).
Set field properties for the Label field according to Table 27.26, Table 27.27, and Table 27.28.
General Property | Value |
Reference Name | LabelApprove |
Left | 75 |
Top | 90 |
Width | 8370 |
Height | 300 |
Format Property | Value |
Font | 12 pt, Bold |
Alignment | Center |
Clicking the Font button on the Format tab displays the Font dialog box, which is used to set font attributes for the entire Label field (you can't mix fonts or font attributes in the same Label field).
The alignment buttons enable you to left-, center-, or right-justify the field's text.
Initial Value Property | Value |
Initial Text | APPROVED EXPENSE REPORT - PLEASE PROCESS |
You are now finished modifying the field properties. Save your changes before proceeding.
To set the window properties, select Window Properties from the View menu. Set the window's General properties as shown in Table 27.29. If Table 27.29 does not specify a property setting, leave the default setting alone.
Property | Value |
Window Caption | Approve Expense Report |
Field Tab Order | (see earlier in the section Setting Field Tab Order on the General tab for the Expense Report form) |
Window Help—caption | Approve Expense Report |
Window Help—body field | This Expense Report has been approved for payment by the employee's manager. |
Set the window's Format properties as shown in Table 27.30.
Property | Value |
Window Icon | C:\EXCHANGE\EFDFORMS\ICONS\PENL.ICO |
Window Sizing Options | Fixed Size |
For descriptions of the different window properties, refer to the subsection Setting Window Properties in the section Expense Report Form earlier in this chapter.
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, select Form Properties from the View menu. Enter values for the form's General properties as described in Table 27.31.
Property | Value |
Version | 1.00 |
Item Type | IPM.Approve.ExpenseReport |
Large Icon | C:\EXCHANGE\EFDFORMS\ICONS\PENL.ICO |
Small Icon | C:\EXCHANGE \EFDFORMS\ICONS\PENS.ICO |
Form Help—caption | Approve Expense Report |
Form Help—body text | This form is used for approving payment of expense reports. |
You are now ready to set the form's Event properties. Save your changes before proceeding.
There is only one Events property that needs to be modified for the Approve form. Because this form is used only to forward an approved expense report form for processing, this form will never be opened as an original form; therefore, the user does not
need to see it in the Forms Library. Set the form's Viewer Menu Command property to Hidden. This will prevent it from showing in the New Forms dialog box.
To set the Hidden property, follow these steps:
Save your changes before proceeding.
As you did with the Expense Report form earlier in this chapter, you will need to install the Approve form into Exchange before you can use the runtime form. Do this by selecting Install from EFD's file menu. For more information about the Install
process, refer to the earlier section Install the Form into the Personal Organization Forms Library for the Expense Report form.
Because this form was designed specifically to work with the Expense Report form, there is no way to properly test it until you integrate the forms. Therefore, don't test this form now. Later in this section, after you install the Decline form into your
Personal Forms library, you will test all three forms together to verify that they behave as expected.
If a manager chooses to decline approval of an expense report form for any reason, he or she will use the Decline form to return the expense report to the employee who submitted it. Use the fields you've already created in the Approve form to build the
Decline form. This will enable you to continue transferring the employee's original information as you send the expense report and its related forms through Exchange.
Now that you've created two forms, you've gained a lot of expertise in using EFD. To give you more exposure to working with EFD, for the Decline form you will rely less on the Wizard, and instead, set more of the event-handling properties yourself.
To build the form, you will do the following:
This time, start EFD, click Next, and then click Finish. This will create a blank form.
Save your form as DECLINE.EFP.
To design the window, you will do the following:
From EFD's Insert menu, select Field. In the Fields from... dialog box, click the Browse button. In the Select Project dialog box, locate your EXPENSE.EFP file. Select it, and click OK. Select Read from the Window drop-down list. In the Fields list,
scroll down to locate Tab, select it, and click the Insert button. EFD will insert a copy of the Tab field onto the Decline form's canvas. Click Close. You are now ready to modify the fields of the Decline form.
In the Field list box on EFD's main window, locate LabelApprove. Select it in the list box and press F4 to display the Field PI (or select Field Properties from EFD's View menu). Modify field properties according to Table 27.32 and Table 27.33.
General Property | Value |
Reference Name | LabelDecline |
Left | 75 |
Top | 90 |
Initial Value Property | Value |
Initial Text | EXPENSE REPORT DECLINED - PLEASE SEE COMMENTS |
Reposition the Tab field by setting its Left property to 75 and its Top property to 420.
You are now finished modifying the field properties. Save your changes before proceeding.
To set the window properties, select Window Properties from the View menu. Set the window's General properties as shown in Table 27.34. If Table 27.34 does not specify a property setting, leave the default setting alone.
Property | Value |
Window Name | Compose |
Window Caption | Decline Expense Report |
Field Tab Order | (see earlier in the section Setting Field Tab Order on the General tab for the Expense Report form) |
Window Help—caption | Decline Expense Report |
Window Help—body field | Use this form to return an Expense Report to the originating employee for corrections. Explain your reason for not approving this report in the Comments tab. |
Set the window's Format properties as shown in Table 27.35.
Property | Value |
Window Icon | C:\EXCHANGE\EFDFORMS\ICONS\NOTE1L.ICO |
Window Sizing Options | Fixed Size |
For descriptions of the different window properties, refer to the subsection Setting Window Properties in the section Expense Report Form earlier in this chapter.
You are now ready to create the Decline form's Read window. Save your changes before proceeding.
Earlier, when you created the Expense Report form, you used the Wizard to create a two-window Send form. When the Wizard created the form for you, it automatically set all the necessary Event properties so that Exchange would know which of your form's
windows to display for specific events. This time, you will create the second window for your Decline form by copying it from the existing Compose window and then manually set all of the form's Event properties to control which window Exchange displays for
the different form events.
To create the Read window, you will do the following:
To copy the Compose window to create a new window, following these steps:
EFD will create the new window, and the window will automatically have the same fields and window properties as those in the Compose window except for the window name, which you just set to Read.
There is no need to modify field properties—the properties copied from the Compose window meet the needs of the Read window as is.
To modify the window properties, select Window Properties from the View menu. Modify the window's General properties as shown in Table 27.36.
Property | Value |
Window Help—body field | This Expense Report has been returned to you by your manager. Please refer to the Comments section of the form for details. |
Copying the Compose window to create the Read window preserved all of the window properties that you already set, including the Field Tab Order. As you can see, using the New Window dialog box with the Copy of feature selected can save a great
deal of design time in this type of form (a form that uses the same fields, layout, names, and so on, in more than one window).
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, select Form Properties from the View menu. Enter values for the form's General properties as described in Table 27.37.
General Property | Value |
Form Display Name | Decline Expense Report |
Version | 1.00 |
Item Type | IPM.Decline.ExpenseReport |
Description | Used to decline approval of a submitted Expense Report form. |
Large Icon | C:\EXCHANGE\EFDFORMS\ICONS\NOTE1L.ICO |
Small Icon | C:\EXCHANGE \EFDFORMS\ICONS\ NOTE1S.ICO |
Form Help—caption | Decline Expense Report |
Form Help—body text | Use this form to return an Expense Report to the originating employee for corrections or changes. |
Save your changes before proceeding.
You will need to manually set the form's Events properties so that Exchange will display the appropriate window for each of the form's events. You will also set the Hidden property for the form like you did with the Approve form.
When the Wizard creates a form, it automatically sets the form's Events properties appropriately. For example, all events that involve an "unsubmitted" item are set to the Compose window, and all events that involve a "submitted"
item are set to the Read window.
Submitted and unsubmitted might be new terms to you. Until a Send form has been sent, or until a Post form has been posted, the item is considered unsubmitted, meaning that it has not been given to Exchange for processing and delivery. After a form has been sent or posted, it becomes a submitted item—an item that has gone through Exchange and been processed and delivered. The events for a single-window form will be set either to Window1 or to Unsupported (meaning that the event is not available to the user).
Select Form Properties from EFD's View menu. Enter values for the form's Events properties as described in Table 27.38. To set Events properties on the Events tab of the Form PI, do the following:
Event | Pass to Window Property/Value |
Create new item | Compose |
Open unsubmitted item | Compose |
Open submitted item | Read |
Print unsubmitted item | Compose |
Print submitted item | Read |
Save unsubmitted item as text | Compose |
Save submitted item as text | Read |
Select the Create new item event again and set the Viewer Menu Command property to Hidden.
Save your changes before proceeding.
As you did with the Expense Report and Approve forms earlier in this chapter, you will need to install the Decline form into Exchange before you can use the runtime form. Do this by selecting Install from EFD's file menu. For more information about the
Install process, refer to Install Form into the Personal Organization Forms Library, earlier in this chapter, for the Expense Report form.
Because the Decline form (like the Approve form) was designed specifically to work with the Expense Report form, there is no way to properly test it until you integrate the forms, which you will do next. Then you will test all three forms together to
verify that they behave as expected.
To make the three forms you have created work together in Exchange, you need to customize some of the properties for the forms' Events properties. The changes you are about to make will tell Exchange what forms to display for which events. This is how
you will give the manager Approve and Decline options for the employee's expense report. You will also provide an option for the employee to make corrections to a declined expense report and resubmit it for approval.
To modify the Expense Report and Decline forms you will first open each form separately in EFD and then make the necessary modifications.
The Approve form requires no further modifications to work with the Expense Report form because after the manager sends it to the Accounting department, its task is finished.
You will now customize the Expense Report form to include Approve Expense Report and Decline Expense Report menu items on the Exchange Client Viewer's Compose menu and on the Read window's Compose menu. To do this, you will set properties for Custom
Response events for the Expense Report form.
Custom Response events are special events that you can define in addition to the standard, default events. You will usually use Custom Response events to enable the user to open other custom forms (EFD forms) from your current form's menu, as you
will do here.
The Custom Response properties will be set in two places:
This can be a little confusing. It is important to understand that each Custom Response menu item (as well as each default Response menu item) is displayed in two places.
You need to change each of these places separately (changing one does not change the other).
To begin customizing the Expense Report form, select Open from EFD's File menu. Use the Open dialog box to locate and open your EXPENSE.EFP file.
To add the Approve Expense Report menu item to the Exchange Viewer's Compose menu and prepare it for integration, do the following:
Adding the fields to the Fields copied: list in step 9 is how your field values get copied from one form to the next. That is, this is how the expense items the employee entered in the original expense report show up in the same places in the Approve and Decline forms; otherwise, the fields would all be blank. This works because the Field Reference Names are identical in both forms.
To add the Decline Expense Report menu item to the Exchange Viewer's Compose menu and prepare it for integration, do the following:
To add the Approve Expense Report and Decline Expense Report menu items to the Read window's Compose menu, do the following:
The Menus tab of the Window PI is where you set properties for all of the window's menu items (that is, you can change the command name of a menu item or add status bar text). Note that these properties are preset by default, and you will usually not make changes to the settings. In the case of your Expense Report Exchange Application, though, you will need to make some minor modifications, as shown in the preceding steps.
The Menu list contains all of the menu items that make up a window's menu bar. The Menu Caption property applies to the menu bar item currently selected in the Menu list.
The Commands list contains all of the individual menu options for the currently selected Menu list item. The Command Caption property applies to the individual menu option currently selected in the Commands list. Note that on a Windows menu, the items typically on the menu bar (File, Edit, View, and so on) are the menu items and the items that appear in the submenu when you click one of these menu items are the menu commands.
For more information on window menu properties, refer to the Application Designer's Guide, or EFD's online help.
In order to incorporate the preceding changes into the runtime form, you will need to reinstall the form into your Personal Forms library. Select Install from EFD's File menu to reinstall the form.
The Expense Report form is now integrated with the Approve and Decline forms.
Now you will add a Correct Expense Report option to the Decline form, which will enable employees to make corrections to their expense reports. This option will simply open a new Expense Report form and copy the field values from the Decline form to the
new Expense Report form. This will effectively give the employees their original expense items, which can now be modified as necessary.
As you did for the Expense Report form, you will now set the necessary properties for the Decline form to add this new option to the Exchange Client Viewer's Compose menu and to the Read window's Compose menu.
To begin customizing the Decline form, select Open from EFD's File menu. Use the Open dialog box to locate and open your DECLINE.EFP file.
To add the Correct Expense Report menu item to the Exchange Viewer's Compose menu and prepare it for integration, do the following:
To add the Correct Expense Report menu item to the Read window's Compose menu, do the following:
Again, as with the Expense Report, in order to incorporate these changes into the runtime form, you will need to reinstall the form into your Personal Forms Library. Select Install from EFD's File menu to reinstall the form.
Now open the runtime Expense Report form and use it as you would expect users to. This is how you test the runtime form to verify that it behaves as you intended.
To open the runtime Expense Report form, follow these steps:
When the Create Expense Report window is displayed, complete at least the first row of expense items, enter the total of the amount column, enter comments on the Comments tab, and send it to yourself.
When the Expense Report form arrives in your inbox, open it as you would any other mail message. From the Read Expense Report window's Compose menu, select Decline Expense Report. When the Decline Expense Report window is displayed, verify that the To:
field already contains your address, and that the Subject: field reads RE: followed by the subject you entered for the Expense Report. Verify that the expense items and total that you entered in the Expense Report are visible in the Decline Expense Report
window. Verify that your comments are contained in the Comments field. Enter new comments into the Comments field, and then send the form.
Open the Decline form in your inbox. Verify that the expense report items are still intact, and that the original comments, along with the additions you made, are still intact. From the form's Compose menu, select Correct Expense Report. Verify that the
expense items and comments are intact. Make modifications to the Expense Report, including adding more comments, and send the form to yourself.
When the corrected Expense Report arrives in your inbox, open it and verify that your changes are visible. From the form's Compose menu, select Approve Expense Report. When the Approve form is displayed, again verify that all information has been
preserved as expected. The Approve form's To: field should be empty, and the Subject: field should read FW: followed by the subject from your corrected Expense Report. Address the form to yourself, send it, and then open the item when it arrives in your
inbox and verify that all information is intact and that you cannot modify any of the fields on the Expense Report tab.
If you find any problems, go back to EFD to make the necessary corrections, and then reinstall the forms and repeat the testing process.
After the forms pass the testing process, you are ready to make them available to the users of Exchange.
To make the forms automatically available to all the Exchange users, you will need to place them in the Organization Forms library. Because the forms currently reside in your Personal Forms library, you can simply copy them to the Organization Forms
library.
From the Exchange Tools menu, select Options. From the Options dialog box, select the Exchange Server tab. Under Exchange Server, click Manage Forms. In the Forms Manager dialog box, you should see a list of organization forms on the left and a list of
personal forms on the right. Under Personal Forms, select the three forms (Approve Expense Report, Decline Expense Report, and Expense Report), and then click Copy. The Forms Manager will copy the three forms to the Organization Forms library.
The forms are now installed in the Organization Forms library, and the Expense Report form will be visible to Exchange users and available for their use. Because the Approve and Decline forms are hidden, they will not be visible to Exchange users, but
Exchange will display them whenever the appropriate menu items are selected from the Expense Report form's compose menu.
You're finished! Your Expense Report Exchange Application can now be used by everyone in your organization.
This section looks at what else you can do with your forms beyond what is provided by EFD. Three topics are covered here:
The Approve form you made as part of the Expense Report Exchange application will lend itself nicely to a public folder application because by putting the approved expense reports into a public folder, the Accounting department, the manager, and the
employee can easily review them. Furthermore, after they are in a public folder, you can create a custom view for that folder so all the expense reports will be listed with the fields of interest shown as columns in the viewer.
In this section you create a public folder called Expense Reports, add the folder to your personal address book, and then set the initial value of the Approve form's To: envelope field to the folder's address. You also create a custom view in the public
folder for viewing the Approve form items.
Note that this topic will require that you have public folders set up on your Exchange Server and that you have a personal address book (PAB) on your client.
You must first create a public folder. In the left column of your Exchange client, locate Public Folders. Open the public folders, and select All Public Folders. From the File menu, select New Folder. In the New Folder dialog box, enter Expense Reports,
and click OK.
To keep other users from accessing this folder until you are finished setting it up and testing the forms, set the Default Permission Role to None. To do so, display the Properties dialog box for the folder by selecting the folder and clicking the right mouse button. In the Permissions tab, change the Default Role to None by selecting Default in the list box and then selecting None in the drop-down list labeled Roles.
To modify the form in EFD, you must first set the Initial Value property of the Approve form's To: field. To complete this step, you need to add the Expense Reports public folder (which you just created) to your personal address book (PAB). This will
ensure that the folder's address is available to you from the Approve form's Form PI.
To add the Expense Reports folder to your PAB, first click the Expense Reports folder with the right mouse button and select Properties. Click the Administration tab in the Properties dialog box and click on the Personal Address Book button to add the
folder address to your PAB. Click OK to close the Properties dialog box.
Start EFD and open APPROVE.EFP. Select the To: field in the Approve form's window and press F4 to display the Field PI. Go to the Initial Value tab and click the To button. In the Address Book dialog box that appears, select Personal Address Book in the
Show Names from the: list. Select the Expense Reports folder on the left and click the To...-> button to add the folder to the Message Recipients list on the right. Click OK.
Click the Subject field on the Approve form. Set the Subject field's initial value to Approved Expense Report.
Setting these initial values automatically addresses your Approve form to the Expense Reports public folder and enters the subject text Approved Expense Report whenever a user selects Approve Expense Report from the Expense Report form's Read window.
Save your changes before proceeding.
You next must install the form into a public folder. As part of converting the Expense Report and its related forms to a Public Folder application, you should first remove the forms from the Organization Forms library. This will ensure that Exchange
users are not creating their expense reports with the wrong forms and using an outdated process. You will use the Exchange Client's Forms Manager dialog box to copy the forms to the Public Folder library, and then delete the forms from the Organization
Forms library.
To do this, select Options from the Exchange Tools menu. In the Options dialog box, go to the Exchange Server tab, and click Manage Forms. In the Forms Manager dialog box, set one side (either side is OK) of the dialog box to Organization Forms Library,
and the other side to the Expense Reports Public Folder. Select the Expense Report and Decline forms in the Organization Forms list and click Copy. Exchange will copy the forms to the Expense Reports folder. (You don't copy the Approve form because you
have to install the revised form into the public folder.) Now select the Expense Report, Approve, and Decline forms again in the Organization Forms library, and click Delete. The forms will be deleted from the Organization Forms library. Close the Forms
Manager dialog box, and then close the Options dialog box.
Now install the revised Approve form into the Expense Reports public folder. From EFD's File menu select Install. When prompted to Set Forms Library, set it to the Expense Reports public folder.
The Expense Report forms, including your newly modified Approve form, are now installed in the Expense Reports public folder. Whenever an Expense Report is approved, the Approved form will automatically be sent to the Expense Reports public folder.
You will now create a custom view for the Expense Reports folder. By creating custom views, you can control and arrange the information displayed in the Viewer so that Exchange users immediately see the relevant data whenever they open the Expense
Reports folder. Creating custom views is an excellent way to make it easy for users to get the information they need from public folders. This can greatly increase the usability of your folders and encourage user participation.
To prepare a form to be used in a custom view, set the Microsoft Exchange Column Name property in EFD's Field PI for each field of your form that you want shown as a column name in the view. When you designed the Expense Report forms, you already
prepared the forms for public folder views when you set the field captions (changing the field caption automatically changes the Microsoft Exchange column name to match, unless you manually change the Microsoft Exchange Column Name property).
Follow these steps to define the view in the public folder:
You will now see the column names you just set in the right side of the Viewer. When new Approved Expense Report messages are sent to the folder, they will automatically be displayed by the columns you just set in your By Expense Report view.
To test the Folder application, select the Expense Reports folder and click the Compose menu. At the bottom of the Compose menu, you will see New Expense Report. When forms are installed into public folders, they are automatically added to the folder's
Compose menu (and their name is automatically preceded by New). Select New Expense Report to open a new form. Complete the form and send it to yourself. Open the item in your inbox, and select Approve Expense Report from its Compose menu. When the Approve
form is displayed, verify that it is already addressed to the Expense Reports public folder and that the subject line reads Approved Expense Report. Send the form. When it arrives in the Expense Reports public folder, verify that it is displayed correctly
in the Viewer.
After you are satisfied that the Expense Report public folder application is working properly, you need to change the default permission role so that Exchange users can access the folder and use its forms. From your Exchange client, select the Expense
Reports folder and click the right mouse button. Select Properties from the menu list. In the Properties dialog box, go to the Permissions tab. Change the Default Role to Author.
The Expense Reports public folder is now ready for use.
After you've designed and installed your form using EFD, you can use Visual Basic for Microsoft Exchange Server to customize your form even further. To do this step you must be familiar with programming in the Visual Basic programming language.
Depending on what you want to customize, you might also need to be familiar with the Microsoft Message API (MAPI) to extend your form. Both of these subjects are beyond the scope of this book, but you can learn more about Visual Basic and MAPI by referring
to the Application Designer's Guide and the Visual Basic documentation.
The following is just a brief example of how to extend your form with Visual Basic. In this example, you will add a CommandButton control to the sample Expense Report form you made earlier in this chapter. When you click this button it will add up the
expenses in the last column and insert the total in the bottom right cell of the expense report.
If you modify the form's code using Visual Basic, you will not be able to load the form back into EFD to make modifications without losing the changes you made by hand. We suggest you make a copy of your hand code before making additional changes to your form in EFD. This will make it easy to insert your code back in afterward.
When you installed EFD onto your system, you also installed a special version of Visual Basic for EFD called Visual Basic for Microsoft Exchange Server. It should have been installed into the Exchange\EFDFORMS\VB directory. Start up this version of VB.
The first thing you want to do is load the VB project that EFD automatically generated when you clicked File.Install on EFD's menu bar. EFD created a subdirectory below the directory in which your EFP file was saved. This directory, Expense.vb, contains
the VB source code that EFD generated. In this directory, you'll find the Expense Report form's project file, Expense.vbp. Load that file into VB as you would load any other Visual Basic project file.
Display the Compose Window's VB form, which is named COMPOSE.FRM. This form should look a lot like the form you created in EFD except that things have been moved around a bit. The first thing you'll want to do is temporarily reposition the canvas a bit
to make your work easier.
Select the control named Canvas_Ctrl in the VB properties window. Canvas_Ctrl is the control that EFD generated for your canvas. Notice that it is a standard VB picture box control.
Note that the Top property of Canvas_Ctrl is currently set to –30. Change that to –1000 to move the interesting part of the canvas up into better view. Remember the original setting of –30 because you'll want to move it back later.
Select a command button control from VB's toolbox and place it in the same location as the Label control whose caption is Total. For simplicity here, just place the command button on top of the label to hide it. You could choose to remove the Label
control altogether, but then you'd have to also remove any code that references it. Position the command button as shown in Figure 27.23. Name the command button control cmdTotal. Give it the caption Tota&l.
FIGURE 27.23. Adding the Total button to the runtime form in Visual Basic.
Set the Top property of Canvas_Ctrl back to –30.
Add the following code to the cmdTotal_Click event in COMPOSE.FRM. This is the only code you need to add to allow your expense form to total the expenses.
Private Sub cmdTotal_Click() Dim curTotal As Currency curTotal = _ CCur(IIf(Amount1_Ctrl.Text = vbNullString, 0, Amount1_Ctrl.Text)) + _ CCur(IIf(Amount2_Ctrl.Text = vbNullString, 0, Amount2_Ctrl.Text)) + _ CCur(IIf(Amount3_Ctrl.Text = vbNullString, 0, Amount3_Ctrl.Text)) + _ CCur(IIf(Amount4_Ctrl.Text = vbNullString, 0, Amount4_Ctrl.Text)) + _ CCur(IIf(Amount5_Ctrl.Text = vbNullString, 0, Amount5_Ctrl.Text)) Total_Ctrl.Text = Format(curTotal, "Currency") End Sub
If you are making a lot of hand-coded changes to your EFD generated code, we suggest you add separate forms, classes, and/or modules, as appropriate, to the EFD generated project instead of adding your code to the existing forms, classes, and/or modules. By doing this you can separate your hand code from the generated code. This will make maintenance of your code more manageable, plus it will make it easier for you to regenerate your code with EFD without losing your hand coded changes.
Now build a new EXE to replace the one generated by EFD; choose Make EXE File from VB's File menu. Do not change the name of the EXE from the one that appears. The name was randomly generated by EFD, and changing it will cause problems when you install
the form.
Now exit VB. You are finished with the hand coding. Don't forget to save your changes if you want to keep them.
Note that if you made a mistake when you enter the code or something goes wrong at this stage and your form doesn't work when you install it, you can simply start over by regenerating the code again from EFD. Of course, you will have to enter your hand-coded changes again from scratch.
For the purposes of this example, assume that the Expense Report form is currently installed into the Expense Report public folder. If it is in the Organization Forms library, you need to make the appropriate changes when you are following the
instructions.
The Forms Manager will install the form into the Expense Report public folder.
If you want to add a new control when you are customizing code and you want the contents of that control to show in the Viewer, you will need to make appropriate changes to the .CFG file. The .CFG file is a text file that you can edit using any text editor. For information on making changes to the .CFG file, see the Application Designer's Guide.
When you test the form, select New Expense Report from the Expense Report public folder's Compose menu. Complete two or more lines of expense items, and then click the Total button. Verify that the Total field receives a value, and that the value is the
sum of all amounts in the Amount column. Send the form to yourself. Open the Expense Report in your inbox and verify that the Total value is intact.
This section looks at additional resources that may be helpful to you for using EFD and designing custom forms. Two topics are covered here:
The Exchange product comes with a collection of sample applications. These samples demonstrate how to use EFD to provide real-world solutions.
You find the sample applications on the Exchange server (in the same location as the Exchange clients), under the SAMPAPPS subdirectory. Within the SAMPAPPS directory, you will find several subdirectories, a readme.wri file, and a sampapps.pst file. The
readme.wri file contains detailed instructions for setting up the sample applications in Exchange Server's public folders. The sampapps.pst file is a preconstructed folder that contains all of the installed sample application folders, forms, and sample
items that demonstrate how to use the individual forms and folder applications. The sample application folders come with predefined custom views (when applicable).
Within each of the subdirectories under \SAMPAPPS, you will find .efp files, readme.wri files, and any Visual Basic hand code (if applicable) for that particular sample application. The readme.wri files contain detailed information about the samples,
including how to use the forms and how to set up the folders.
You can open the .EFP files in EFD, where you can examine the properties to see how the forms are designed. You can also modify the forms to customize them for use within your organization. For additional information about any given form's design,
consult the form's Designer Notes from within EFD (open the .EFP file in EFD, and then press Ctrl+F1 to display Designer Notes, or select Designer Notes from EFD's Help menu).
There are several other locations you might want to look for additional information on designing forms with Microsoft Exchange Forms Designer. Some are listed in the following sections.
EFD comes with extensive context-sensitive online help. Most of your questions should be easily answered by simply pressing the F1 key.
The Application Designer's Guide is the printed documentation that comes with EFD. It goes into much more detail than this chapter can, particularly with respect to extending forms and working with MAPI.
If you really want to get down to the level of basic Messaging API coding, you'll want to study MAPI. You can get more information on MAPI from Microsoft and you can find it on the Microsoft Developer's Network (MSDN). To find out how to subscribe to
MSDN, check out http://www.microsoft.com/msdn on the Web.
Microsoft maintains a web site specifically devoted to Microsoft Exchange. You should check this site frequently for additional information and new developments regarding Microsoft Exchange and EFD. As additional software and tools become available, you
will probably find information about them here. You can find the Web site at the following:
http://www.microsoft.com/exchange
The Application Farm is another Web page maintained by Microsoft. It is a place to look for a variety of sample applications for Microsoft Exchange. You can find the Web site at the following:
http://www.microsoft.com/technet/boes/bo/mailexch/exch/tools/appfarm/appfarm1.htm
Microsoft maintains a peer-to-peer newsgroup on the Internet specifically designed for discussing Exchange. It's called microsoft.public.exchange.applications and can be accessed on the msnews.microsoft.com server. Here you can ask questions and discuss
topics related to EFD with other EFD users. Check http://www.microsoft.com/exchange for information on how to get to this newsgroup.
In this chapter, you learned how to create Microsoft Exchange forms using the Microsoft Exchange Forms Designer. This chapter covered how to use the EFD Wizard to start your form, how to customize the form by adding windows and fields and setting their properties, how to join forms together into an Exchange application, how to install your completed form into the Exchange Server, and finally, advanced topics on extending the capabilities of EFD.