Tải bản đầy đủ (.pdf) (94 trang)

Module 3: Creating Forms by Using Microsoft Outlook 2000

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.29 MB, 94 trang )




Contents
Overview 1
Introduction to Outlook 2000 Forms 2
Building a Simple Outlook 2000 Form 10
Working with Controls 26
Working with Fields 31
Performing Actions 44
Using Office Document Forms 49
Persisting Form Design 54
Lab A: Building the Computer Services
Task Form 70
Review 88

Module 3: Creating
Forms by Using
Microsoft Outlook 2000


Information in this document is subject to change without notice. The names of companies,
products, people, characters, and/or data mentioned herein are fictitious and are in no way intended
to represent any real individual, company, product, or event, unless otherwise noted. Complying
with all applicable copyright laws is the responsibility of the user. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of Microsoft Corporation. If, however, your only
means of access is electronic, permission to print one copy is hereby granted.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any


written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.

 1999 Microsoft Corporation. All rights reserved.

Microsoft, Active Desktop, Active Directory, ActiveX, BackOffice, Developer Studio, FrontPage,
JScript, MSDN, MSN, NetMeeting, Outlook, PivotChart, PivotTable, PowerPoint, Visual Basic,
Visual C++, Visual FoxPro, Visual InterDev, Visual J++, Visual SourceSafe, Visual Studio,
Windows, Windows Media, and Windows NT are either registered trademarks or trademarks of
Microsoft Corporation in the U.S.A. and/or other countries.

The names of companies, products, people, characters, and/or data mentioned herein are fictitious
and are in no way intended to represent any real individual, company, product, or event, unless
otherwise noted.

Other product and company names mentioned herein may be the trademarks of their respective
owners.


Project Advisor: Janet Wilson
Project Lead and Instructional Designer: Anne Bockman (Excell Data Corporation)
Instructional Designers: Josh Barnhill (Volt Technical) and Jo Berry (Exchange)
Lead Program Manager: Greg Bott
Program Managers: Colleena Carr and Chris Boar (Intl Vendor)
Graphic Artist: Andrea Heuston (Artitudes Layout and Design)
Editing Manager: Lynette Skinner
Editor: Jennifer Kerns (S&T Onsite)
Copy Editor: Shari G. Smith (R & S Consulting)
Online Program Manager: Arlo Emerson (Aditi)
Production Support: Irene Barnett (Barnett Communications)

Manufacturing Manager: Bo Galford
Manufacturing Support: Mimi Dukes (S&T Onsite)
Development Services: Kimber Dodge
Lead Product Manager: Mary Larson
Group Product Manager: Robert Stewart


Module 3: Creating Forms by Using Microsoft Outlook 2000 iii


Instructor Notes Module 3: Creating Forms by Using
Microsoft Outlook 2000
This module shows students how to develop simple and complex custom forms
by using Microsoft
®
Outlook
®
2000.
At the end of this module, students will be able to build simple forms that use
fields, standard controls, and Microsoft ActiveX
®
controls, and set form and
control properties. Students will be able to describe how data is stored with an
item and how controls are bound to fields. Students will be able to work with
fields and define custom fields for their forms. They will also learn about form
actions and how default and custom actions can be used. Students will be able
to create custom forms that are based on Microsoft Office documents. Finally,
they will learn how to save a form and make it available to other users.
Materials and Preparation
This section provides you with the materials and preparation needed to teach

this module.
Materials
To teach this module, you need the following materials:

Microsoft PowerPoint
®
file 1593a_03.ppt

Module 3, “Creating Forms by Using Microsoft Outlook 2000”

Preparation
To prepare for this module, you should:

Read all the materials for this module.

Read the instructor notes and margin notes for the module.

Complete the lab.

Rehearse the practices.

Rehearse the demonstration.

Presentation:
150 Minutes

Lab:
60 Minutes
iv Module 3: Creating Forms by Using Microsoft Outlook 2000



Module Strategy
Use the following strategy to present this module:

Introduction to Outlook 2000 Forms
Provide an introduction to Outlook 2000 forms by describing the various
form types. Then, describe the various elements that students can use to
customize forms. Most of these elements are described in this module, while
others (scripting and the Script Editor) are described in subsequent modules.
Define the purpose of the message class.

Building a Simple Outlook 2000 Form
Describe how to build a simple Outlook 2000 form by using the Outlook
Form Designer. Explain how to avoid common design mistakes for
Outlook 2000 forms that will be converted into Web forms by using the
Outlook HTML Form Converter.

Working with Controls
Explain how to perform advanced customization by setting standard and
advanced control properties, setting the tab order of controls on a form, and
binding standard and ActiveX controls to form fields.

Working with Fields
Describe three types of custom fields and how they are created: simple,
formula, and combination fields. Provide an overview of how to restrict
field access by using scripting. Describe how to ensure that users enter
values or valid data into fields by using field validation.

Performing Actions
Describe how to invoke forms through actions performed by users and how

to create custom reply forms.

Using Office Document Forms
Show how to use a Microsoft Office document within a form.

Persisting Form Design
Describe how to test, save, and publish a form. Define the forms cache and
demonstrate how to clear the forms cache. Explain how to use the
MessageClass property of an item, and the DefaultItemType and
DefaultMessageClass properties of a folder to control how a solution views
and edits items.

Module 3: Creating Forms by Using Microsoft Outlook 2000 1


Overview

Introduction to Outlook 2000 Forms

Building a Simple Outlook 2000 Form

Working with Controls

Working with Fields

Performing Actions

Using Office Document Forms

Persisting Form Design



At the end of this module, you will be able to:

Select the type of Microsoft
®
Outlook
®
2000 form that is most appropriate
for a given scenario.

Create a new form by setting form properties, adding standard and
Microsoft ActiveX
®
controls, and setting their properties.

Bind controls to fields.

Define custom formula and combination fields for a form and use field
validation.

Create a Reply form that controls how users reply to a form.

Create a new form that is based on a Microsoft Office document.

Save and publish a form so that it is available to other users.

Slide Objective
To provide an overview of
the module topics and

objectives.
Lead-in
In this module, you will learn
about building custom forms
in Outlook 2000.
2 Module 3: Creating Forms by Using Microsoft Outlook 2000






Introduction to Outlook 2000 Forms

Types of Outlook 2000 Forms

Outlook 2000 Form Components

Introduction to the Message Class


Outlook 2000 provides a number of built-in form types that can be customized.
Recognizing these types and understanding their specific capabilities can save
development time by taking advantage of the built-in functionality of each form
type.
Outlook 2000 also provides tools that you can use to customize forms. You can
use these tools to add additional controls and fields to forms, to respond to user
activity, or to add script code to further customize the built-in forms.
When working with forms in the Outlook 2000 design environment, you have
to base the design of custom forms on built-in forms. Unlike Microsoft

Visual Basic
®
forms, it is impossible and unnecessary to start with a blank
Outlook 2000 form. Because an Outlook 2000 form will always be sent or
posted, you always start with a Send form or a Post form. After you customize
your form, you can publish it. When you publish your form, a message class is
automatically generated by Outlook 2000 from the form name and is assigned
with the form. The message class is an internal identifier used by Outlook 2000
and Microsoft Exchange Server to locate and activate a form. When a form with
that message class is selected, Outlook 2000 loads and displays an instance of
that form.
Slide Objective
To outline this topic.
Lead-in
There are a variety of form
types and customization
tools you can use to build
Outlook 2000 forms.
Module 3: Creating Forms by Using Microsoft Outlook 2000 3


Types of Outlook 2000 Forms

Mail Message Forms

Request forms, survey forms, and report forms

Post Forms

Applications with threaded conversation views


Modifying Other Built-In Forms

Appointment, contact, distribution list, journal entry, and
task

Office Document Forms

Message or post forms with an embedded Office
document


You can create custom forms more efficiently when you fully understand the
different types of forms that are available. The design environment for
Outlook 2000 forms is called the Outlook Form Designer. Another term used to
describe the design environment is “design mode.” The Outlook Form Designer
provides the following form types as a starting point for a new custom form.
Mail Message Forms
Use the mail message form to build custom forms for structuring information,
requesting services, or collecting information. When you use a mail message
form, you inherit all the built-in capabilities of the form, such as automatic
name resolution and nickname support, and most fields on the form can be
customized. The only field that your new form will inherit that cannot be
changed is the Send button at the top of the form. With a mail message form, a
user can send information to another user, distribution list (DL), or folder
within a site or across the Internet.
You should base your custom form on a mail message form when you need the
ability to send information across the e-mail system.
The following are examples of custom mail message forms that can be
developed with the Outlook Form Designer:


Request forms. Use these forms for purchase orders, copier services,
business cards, travel requests, and so on.

Survey forms. Use these forms to collect feedback from coworkers. For
example, an Employee Satisfaction Survey form enables Outlook 2000
users to provide feedback by filling in the form, and then routing the form to
the Employee Satisfaction public folder.

Report forms. Use these forms to structure and distribute information. For
example, status reports, weekly time sheet forms, or mileage reports.

Slide Objective
To list and describe the
types of Outlook 2000
forms.
Lead-in
Outlook 2000 comes with a
variety of forms that you can
customize for your specific
needs.
4 Module 3: Creating Forms by Using Microsoft Outlook 2000


Post Forms
Most collaborative solutions make use of the post form. The post form is best
used in an application that posts and retrieves messages in a public folder.
The following are examples of custom post forms:

Forms for a technical user group. Use these forms to enable users to submit

problems and solutions to problems, as well as to review and respond to
submitted problems.

Product wish list forms. Use these forms to submit ideas and requests to a
Suggestions folder and to respond to suggestions. Product planners can then
review the folder for new product ideas.

Help desk System. Use these forms to post help desk requests to a public
folder. Help desk technicians can update the information in each request or
mark it as resolved. Concurrently, users can view the status of their requests.

By default, Exchange Server hides the addresses of public folders from the
Global Address List (GAL). For this reason, before you can send an e-mail
message to a public folder, you must either have the Exchange Server
Administrator change the default settings to make the e-mail address of the
public folder available from the GAL, or have users add the e-mail address of
the public folder to their Contacts folder.
Modifying Other Built-In Forms
The Outlook 2000 built-in forms (appointment, contact, distribution list, journal
entry, and task) contain form-specific functionality, which you can customize
by displaying additional form pages and adding controls. However, it is not
always possible to modify all of the pages of a form. For example, you cannot
modify the Appointment or Attendee Availability pages on the appointment
form. However, the other five pages on the contact form are modifiable.
Some controls, such as the Date and Time Picker selection control on the first
page of a tasks form and appointment form can now be accessed by
customizing the Toolbox and selecting Microsoft Date and Time Picker
Control.
You should utilize the rich functionality of built-in forms whenever possible
because these forms can provide valuable business functionality for very little

development cost. For example, assume that your solution includes a public
folder that contains all the vendors used by your company. If you implement
this folder using a modified contact form, the functionality of the contact form,
such as New Letter to Contact and New Mail to Contact becomes part of
your application. If you base the form on a post form instead, you would have
to add this functionality through script code inside the form.
Module 3: Creating Forms by Using Microsoft Outlook 2000 5


Office Document Forms
Office document forms are either e-mail messages or post forms that contain an
embedded Microsoft Excel, Microsoft Word, or Microsoft PowerPoint
®

document. Wrapping an Outlook 2000 form around an Office document
incorporates the features of the hosted document into the Outlook 2000 form.
These types of forms are best used when you want the replication and form
library support of Outlook 2000, but you also want the functionality of other
Office applications. An example of an Office document form is an Expense
Report application. In an Expense Report application, an Excel spreadsheet is
embedded in a post form.
6 Module 3: Creating Forms by Using Microsoft Outlook 2000


Outlook 2000 Form Components

Compose and Read Pages

Standard Controls


Fields

Properties

Actions

Script Editor


Because every item in Outlook 2000 is based on a form, understanding the
components of a form is essential to creating forms that can distribute and
collect information that is essential to your environment.
Compose and Read Pages
Each page within an Outlook 2000 form can be split into two different pages, a
compose page—the page that is displayed when the item is being composed—
and a read page—the page that is displayed when the item is being read. The
compose page and the read page can either have minor differences or have a
completely different look and feel. An example of this is a standard e-mail
message. When composing an e-mail message, you can edit the To, Cc, and
Subject fields. When you read an e-mail message, these fields cannot be edited,
because on the read page, these controls have been set read-only. The read page
of the Message tab also contains an additional field, Sent, that displays the date
and time the e-mail message was sent.
Compose and read options apply to each page within a form. You cannot
specify individual fields within a page as compose or read. If you want to use
essentially the same page as both a compose and read page but want to make
any changes at all to one or the other, you must create a duplicate of the first tab
and then modify it. To create a duplicate, create your page before separating it
into a compose and read page. You can also combine separated pages into one.
Doing so discards changes to one of the pages.

Standard Controls
Controls determine how a user interacts with a form. Outlook Form Designer
provides a Toolbox that has 15 standard controls for custom form design. You
can customize the Toolbox by adding ActiveX controls and by adding more
pages to the Toolbox.
Slide Objective
To list the components that
enable Outlook 2000 form
development.
Lead-in
Outlook 2000 supports a
number of tools and
technologies that you can
use to customize forms.
Module 3: Creating Forms by Using Microsoft Outlook 2000 7


Fields
Fields are used to store the contents of a message. You view the contents of a
field through controls on a form that are bound to fields within the message.

You must bind the control to a form if you want to save a value to or from a
control. For example, within a standard mail message, the Subject field is
displayed using a text box control bound to the Subject field.
Outlook 2000 (and the MAPI subsystem) defines a number of commonly used
fields. You can create new fields for use in your own applications if an existing
field does not meet your needs.
Properties
The Properties page contains information about the form, such as its
description and version number, and the icons used for the form when it is

displayed in an Outlook 2000 view.
Each control on a form page also has properties that enable you to adjust the
appearance or functionality of the control. To access the properties, on the
shortcut menu, right-click the control, and then click Properties or Advanced
Properties.
Actions
Actions are different ways to create forms in response to an event. You can
modify existing actions or create new ones.
Script Editor
Outlook 2000 provides a Script Editor that allows you to use Microsoft Visual
Basic, Scripting Edition (VBScript) to add functionality to a form. For example,
you can add code to a control that runs in response to user interaction. When the
user changes a value in a text box, the code can automatically populate a combo
box with items based on this value.
8 Module 3: Creating Forms by Using Microsoft Outlook 2000


Introduction to the Message Class

Built-in Forms and the Message Class

Custom Forms and the Message Class

Message class for a custom form called “Customer”
IPM.Contact.Customer
Form Name
Outlook item type
on which the form is based
Same for all Outlook Items



The message class is an identifier used by MAPI to locate and display a form. A
message class is generated automatically by Outlook 2000 from the form name
and is assigned to each form.
MAPI separates user data and forms to reduce the network traffic required to
deliver a message from one person to another. Typically, only the actual data
provided by the user, along with the message class of the form, is transmitted.
The message class is a single field that holds the name of the form that is
required to display the content of the message.
Built-in Forms and the Message Class
A message class starts with IPM (Interpersonal Message) and is followed by a
string that identifies the Outlook 2000 item. These strings form a hierarchy that
defines the form.
Outlook 2000 item Message class

Message IPM.Note
Post item IPM.Post
Appointment IPM.Appointment
Contact IPM.Contact
Journal IPM.Activity
Task IPM.Task
Note IPM.StickyNote
Distribution List IPM.DistList

Slide Objective
To describe the purpose of
the message class.
Lead-in
Outlook 2000 decides what
form to use to view and edit

items by examining the
item’s message class.
Module 3: Creating Forms by Using Microsoft Outlook 2000 9


Custom Forms and the Message Class
Custom forms developed within the Outlook 2000 forms environment must be
based on an existing form. For example, if you create a custom form called
Customer, based on an IPM.Contact.Nwind form, the message class is
IPM.Contact.NwindCustomer.
The periods in the message class are important. If an Outlook 2000 client is
unable to locate the form definition for IPM.Contact.Nwind.Customer then it
will truncate at the right-most period and look for a form called
IPM.Contact.Nwind. If it is unable to locate this form definition, it will look for
a form called IPM.Contact.
10 Module 3: Creating Forms by Using Microsoft Outlook 2000






Building a Simple Outlook 2000 Form

Starting the Outlook Form Designer

Setting Form Properties

Adding Fields to a Form


Adding Standard Controls to a Form

Customizing the Toolbox

Using the Form Layout Tools

Working with Form Pages

Following HTML Forms Converter Design Guidelines


To build a simple Outlook 2000 form:
1. Open the item on which you want to base the form and then start the
Outlook Form Designer.
2. Set attributes for the form, such as a caption, password, or description on the
Properties page.
3. Design the form by moving, removing, or adding fields and controls, and
showing and hiding pages in the form.
4. Test and publish the form.

Slide Objective
To outline this topic.
Lead-in
Outlook 2000 provides an
environment for creating
and editing forms that is
referred to as the Outlook
Form Designer.
Module 3: Creating Forms by Using Microsoft Outlook 2000 11



Starting the Outlook Form Designer
Untitled - Message (Rich Text) (Design)
Subject:
Send
S
end
Message (P.2) (P.4) (P.5)(P.3)
To…
C
c…
(All Fields)(P.6)
Edit Read Page
File Edit View Insert Format Tools Actions FormLayout Help
Op
tions...
(Properties) (Actions)
Edit Compose Page
Edit Compose Page


The Outlook Form Designer is a 32-bit environment development tool that is
included with Outlook 2000. It is not necessary to choose any setup options to
obtain it. Any user who has the Outlook 2000 client installed on his or her
computer can create custom forms.
Starting the Outlook Form Designer
To start the Outlook Form Designer:
1. Open an Outlook 2000 item.
2. On the Tools menu of the form, point to Forms, and then click Design this
form.

A dialog box appears, displaying several tabs with “(Design)” appended to
the form name on the title bar, which indicates that the Outlook Form
Designer is in design mode.

Slide Objective
To show an example of a
form in the Outlook Form
Designer.
Lead-in
The Outlook Form Designer
is the environment that you
use to customize forms.
12 Module 3: Creating Forms by Using Microsoft Outlook 2000


Setting Form Properties
Untitled - Message (Rich Text) (Design)
Always use Microsoft Word as the e-mail editor
Send
S
end
Message (P.2) (P.4) (P.5)(P.3)
Description:
Template.
..
C
ontact...
Change Large Icon...
Ca
tegory:

Sub-Category
:
Version
:
Form Numb
er:
Send form definition with item
Use form only for responses
Change Small Icon...
Set Password...
Protect form design:
(All Fields)(P.6)
Edit Read Page
Ed
it Read Page
File Edit View Insert Format Tools Actions FormLayout Help
Op
tions...
(Properties) (Actions)
Edit Compose Page
Edit Compose Page


Form properties determine form characteristics, such as the category or the
icons displayed with the form. To configure form properties, open the form in
design mode, and then click the Properties tab. The following table describes
each form property.
Property Used to

Category Create or specify a category for the form to help organize the

forms in the New Form dialog box.
Sub-Category Create or specify a sub-category for the form.
Always use Microsoft
Word as the e-mail
editor
Specify that messages use Word editing features in the body
of the message. With this option, users have access to spell
checking, thesaurus, and full formatting options.
Template Specify the Word template that is used to format the text in
body of the message.
Contact Select the names of those people who are responsible for
maintaining and upgrading the form.
Description Type a description for the form. The form description appears
in the About This Form dialog box on the Help menu, and
also in the Properties dialog box for the form.
Version Set a version number for this form. It is important to set this
and update it with each modification.
Form Number Set a number for this form. You can use the form number to
match forms with corresponding features in the product
specification for the solution.
Change Large Icon Choose an icon other than the default.
Slide Objective
To show the Properties
page of the Outlook Form
Designer.
Lead-in
The Properties page of the
Outlook Form Designer
enables you to set
characteristics of the form,

such as its category or
version.
Module 3: Creating Forms by Using Microsoft Outlook 2000 13


(continued)
Property Used to

Change Small Icon Select the small icon that will display in a table view.
Protect form design Enable password protection for the form. You should set this
for all custom forms that you do not want others to modify.
Send form definition
with item
Specify that the form definition should be included with the
item. This makes the form available to users who may not
have access to the Organizational Forms Library.
Use form only for
responses
Specify that the form will be a response-only form. Use this
option in situations when you have created a form that is
intended only for replies. In another form, you can specify
that your reply form will be used as the default reply form.

Most of these form properties are self-explanatory. Two properties, Send form
definition with item and Use form only for responses, require more
explanation.
Selecting the Send Form Definition with Item Option
When this form property is selected, a self-contained form is created that allows
your recipients to view the form even if they do not have access to the same
forms library as the sender. If this property is not selected, and the user does not

have access to the form from a forms library, the user will receive the default
form for the message class in which the custom form is based upon instead of
the one that you have created.
When your form contains code, this option provides security for forms. When a
recipient opens the form, a Warning message appears. The recipient has the
option of disabling the macros if the form is not from a trusted source.
Selecting this property causes the form to be much larger than if this option is
not selected. If network or file transfer time is an issue, an alternative to sending
the form definition is to save the form and send it as an attachment to another
form. Recipients can take the attached form and publish it in their personal
forms library.

Under most circumstances, this form property should not be selected.

Selecting the Use Form Only for Responses Option
This option is used in situations when you have created a form that is used only
for replies. In another form, you can specify that your reply form will be used
instead of the default reply form. The Reply Only form will not appear in a
Choose Form dialog box.
To use your form only for responses, check the Use form only for responses
check box, and then publish your form. Open a second form in design mode.
On the Actions page of the second form, you can specify your published form
in the Reply or Reply to All action. To use your form as the default reply form,
double-click the Reply action in the second form. You can select the name of
your published reply form in the Form name field of the Form Action
Properties dialog box. This will cause your reply form to be used instead of the
default reply form.
Note
14 Module 3: Creating Forms by Using Microsoft Outlook 2000



Adding Fields to a Form
Field Chooser
Frequently-used fields
N
ew…
Attachment
Categories
Cc
Contacts
Conversation
Created
Do Not AutoArchive
Download State
Due By
Flag Status
Follow Up Flag
From
Icon
Delete
D
elete


Fields are containers that store values about an item or items. The Field
Chooser is used to create fields, delete fields, or add existing fields to a form.
When a form is viewed in design mode, access to the Field Chooser is provided
by default.
If the Field Chooser is not visible, click Field Chooser on the Form menu to
open it, or right-click the form background, and then click Field Chooser.


Adding Existing Fields to a Form
You can add existing fields to a form by using the Field Chooser. Click the
desired field, and then drag it from the Field Chooser to the form. By default,
the value for a field is displayed in a control that is appropriate for the type of
data contained in the field. For example, if you drag the To field to a message
form, a To button and an edit box are placed on the form. When you click the
To button, the Select Names dialog box is displayed. Once a recipient name is
selected, the name appears in the Edit box.

When an item is stored in a Microsoft Exchange Server mailbox, the
number of characters is typically limited to 32 kilobytes (KB), whereas if the
item is stored with a Personal Folders (.pst) file, the limit is typically 16 KB.
For example, on an Exchange Server computer, the limit would be 32 KB
characters for the sum of all user-defined fields. Also, the total data for the sum
of all standard fields must not exceed 32 KB.
Outlook 2000 does not generate a warning when the item is saved. Instead, the
item will appear to save without any problems. However, when the item is
opened, the text will be missing and not accessible through the Outlook 2000
interface or the Outlook object model. Although the data is not displayed, it has
been stored within Exchange Server.

Slide Objective
To show the Field Chooser.
Lead-in
Outlook 2000 provides fields
to store items. The Field
Chooser provides a simple
way to drag and drop built-in
and custom fields to your

form.
Note
Module 3: Creating Forms by Using Microsoft Outlook 2000 15


Adding Standard Controls to a Form
Untitled - Message (Rich Text) (Design)
Subject:
Send
S
end
Message (P.2) (P.4) (P.5)(P.3)
To…
C
c…
(All Fields)(P.6)
Edit Read Page
File Edit View Insert Format Tools Actions FormLayout Help
Op
tions...
(Properties) (Actions)
Edit Compose Page
Edit Compose Page
Toolbox
Controls


You can add standard controls to a form by using the default controls contained
in the Toolbox.
To display the Toolbox:

• On the Form menu, click Control Toolbox.

To add a control to a form:
• Drag the control from the Toolbox to the form.
Dragging a control to a hidden page (a page with parenthesis around its
name) will make the page visible.

Saving the Value of a Control
To save the value entered into a control, you must either bind it to an existing
field, to a custom field, or create a new custom field.
Adding Code to a Control Event
You can add code that responds to user events by using the Outlook Script
Editor.
To add code to a control:
1. Start the Outlook Form Designer.
2. Add a standard control to a form.
3. Right-click the control and then click Properties.
4. On the Display tab, type a name for the control in the Name box, and then
click OK.
Slide Objective
To show the Outlook Form
Designer with the Toolbox
displayed.
Lead-in
The Toolbox provides an
easy way for you to pick
controls when you design
your forms.
16 Module 3: Creating Forms by Using Microsoft Outlook 2000



5. On the Form menu, click View Code. This opens the Outlook Script Editor.
6. In the Script Editor, type the event procedure for the control. For example,
to write a procedure for the Click event for a control, type:
Sub controlname_Click()

End Sub

7. Add the code you want to run when this event occurs to the procedure, and
then return to the Outlook Form Designer.
8. On the Form menu, click Run This Form to test the form.

Module 3: Creating Forms by Using Microsoft Outlook 2000 17


Practice: Adding Code to a Control Event


In this practice, you will create a simple event procedure for a command button
control.

To create a new form
1. Open a mail message.
2. On the Tools menu, point to Forms, and then click Design This Form.
3. Use the Toolbox to add a new command button control to the form.


To add code to the Click event of the command button control
1. Right-click the command button control and then click Properties.
2. On the Display tab, set the following properties:

Property Value

Name cmdClickMe
Caption &Click Me

3. Click OK.
4. In the form, on the Form menu, click View Code.
5. In the Script Editor, type the following code:
Sub cmdClickMe_Click()
MsgBox "Hello, World!"
End Sub

6. Close the Script Editor.
7. On the Form menu, click Run This Form. Click the Click Me button to
test it.

Slide Objective
To practice adding code to
the Click event.
Lead-in
In this practice, you will add
code to a control event.
18 Module 3: Creating Forms by Using Microsoft Outlook 2000


Customizing the Toolbox

Importing or Exporting a Toolbox Page

Adding Controls to the Toolbox


Adding Pages to the Toolbox

Creating a Control Group


ActiveX controls can be added to the Toolbox to provide added flexibility on
forms. You can purchase ActiveX controls from third-party vendors, or you can
create your own by using Visual Basic.

Before customizing the Toolbox, export the Toolbox settings so that if you
want to return the Toolbox to its original state you can simply import the saved
design.

Importing or Exporting a Toolbox Page
It is a good idea to save the default state of the initial Toolbox page before
customizing it. Once you have set up a Toolbox page with the controls that you
want, you can export the page and make it available to other developers.
To import or export a Toolbox page:
1. Display the Toolbox.
2. To import a page, right-click the label of any page in the Toolbox, and then
click Import Page on the shortcut menu.
3. To export a page, right-click the label of the page, and then click Export
Page on the shortcut menu.
4. In the File name box, type the name of the page that you want to import or
type the name of the file to which you want to export a page.

Slide Objective
To list the different ways
that you can customize the

Toolbox.
Lead-in
You can also add custom
controls to the Toolbox and
use the features of the
Toolbox to manage them.
Tip
Module 3: Creating Forms by Using Microsoft Outlook 2000 19


Adding Controls to the Toolbox
Before you add an ActiveX control to a form, you must add the control to the
Toolbox.
To add an ActiveX control to the Toolbox:
1. Right-click the Toolbox, and then click Custom Controls.
The Additional Controls dialog box is displayed.
2. Select the controls that you want to add, and then click OK.


If you add an ActiveX control to your form, you must also provide the
control (the .ocx file) to the user when you distribute your application.

Adding Pages to the Toolbox
If you want to add a number of controls to the Toolbox, you can add a new page
to contain them. You can use the new pages to organize the controls.
To add a new page to the Toolbox and rename it:
1. Right-click the Controls tab in the Toolbox, and then click New Page.
2. Right-click the New Page tab, and then click Rename.
3. Provide a Caption and Control Tip Text (optional), and then click OK.


Creating a Control Group
If you frequently use a group of controls together, you can add those controls to
the Toolbox as a control group.
For example, if you often create a form that has two command buttons and
several text boxes in a particular layout, you can create a control group that
includes these controls. When you create a new form, you can use the control
group to add the same set of controls in the same layout.
To add a control group to the Toolbox:
1. Select a group of controls on a form.
2. Drag the controls to the Toolbox.
3. Right-click the control group, and then click Customize New Group to
assign Tool Tip Text for the control group or to assign a new picture to
represent the group on the page.

Note
Delivery Tip
If time permits, demonstrate
how to create a control
group.
20 Module 3: Creating Forms by Using Microsoft Outlook 2000


Using the Form Layout Tools

Align

Make Same Size

Size to Fit


Size to Grid

Horizontal Spacing
and Vertical Spacing

Center in Form

Arrange

Group and Ungroup

Order

Show Grid and Snap
to Grid

AutoLayout


The Outlook Form Designer provides a wide assortment of layout features to
speed application development and to give forms a professional appearance.
The layout commands are located on the Layout menu in the Outlook Form
Designer. The following table lists and describes some of the commands on the
Layout menu.
Layout menu command Used to

Align Align the selected controls to the Left, Center, Right,
Top, Middle, Bottom, or To Grid.
Make Same Size Make controls even heights or even widths, or even in
both height and width.

Size to Fit Resize the controls to the relative size of the page, both at
design time and at run time.
Size to Grid Resize the control to the nearest grid.
Horizontal Spacing and
Vertical Spacing
Distribute spacing evenly between objects.
Center in Form Center the controls either vertically or horizontally
between the edges of the form.
Arrange Arrange the controls to the right or bottom of the form.
Group and Ungroup Assemble two or more objects into a group so that they
can be moved or modified together.
Order Change the order of overlapping controls. You can
specify Bring to Front, Send to Back, Bring Forward,
or Send Backward options for selected controls.
Slide Objective
To list the form layout tools.
Lead-in
You can use the form layout
tools to develop your forms
more efficiently.
Module 3: Creating Forms by Using Microsoft Outlook 2000 21


(continued)
Layout menu command Used to

Show Grid and Snap to
Grid
Display the grid, which helps you align controls evenly
on a page. Snap to Grid causes controls to align with the

grid automatically as they are placed on the page.
AutoLayout Cause controls to position on the form automatically. For
example, if a new control is dragged below an existing
control, the new control is automatically aligned to the
left, in the first available position on the form.

×