Tài liệu [ Team LiB ] Creating Custom Forms pdf

11 269 0
Tài liệu [ Team LiB ] Creating Custom Forms pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[ Team LiB ] Creating Custom Forms Although the standard Outlook forms are often good enough, there are times when you'll wish the form had different fields You might want to remove some of the default fields, add some of your own, or just rearrange what's there You might want to create a boilerplate message to use in response to inquiries, or preaddress a message form to a group of people with whom you often correspond You can all of this and more using custom forms You can create templates and forms containing boilerplate text by editing the fields in the form But when you want to add or remove fields or use scripting with the form, you need to use Design mode to open Outlook forms so that they can be edited You don't need a special program to use Design mode; it's part of every form included with Outlook and is enabled when you tell Outlook you want to design a form You can open a form in Design mode two ways: by using Tools, Forms, Design a Form and selecting a form from the dialog; or when a form is already open, by using its Tools, Forms, Design this Form menu option In any case, when it's a message form, it will look similar to Figure 20.1 Figure 20.1 A message form in Design mode Hidden pages have parentheses around their names Drag fields from the Field Chooser to add them to a form or create your own fields You need to use Outlook as your email editor to design email forms or templates When Word is your editor, you can't go into Design mode for email forms When forms are in Design mode, the Form Design toolbar is visible (see Figure 20.2) This toolbar has many of the design tools you'll use the most The Form and Layout menus also contain design tools Figure 20.2 The Forms toolbar has many of the commands you'll need when you customize your forms Customize the Forms toolbar to add the Run This Form button to it Doing so makes it easier to test your forms as you design them Along with the Form Design toolbar, you'll also use the Field Chooser and Control Toolbox to create your custom forms Right-click on any control to access the Properties and Advanced Properties dialogs The Properties dialog contains display, value, and validation information for the control, whereas Advanced Properties has more advanced display properties To design forms, drag controls from the Control Toolbox or fields from the Field Chooser and configure the properties Select the control and drag it to the form, dropping the control when the mouse cursor is over the area where you want the control placed When you drag fields to the form, the fields are automatically arranged on the left edge of the form A feature many people request is to list a person's age on the contact form, so I'll show you how to create a custom form with the contact's age on it Task: Design a Form Designing a custom form is actually pretty easy, at least for simple forms You can customize any Outlook form, except for message forms, when you use Word as the editor Open the Design Form dialog using the Tools, Forms, Design a Form Menu (see Figure 20.3) The Standard form library contains the form types that can be customized Figure 20.3 The Design Form dialog lists all forms currently installed on your computer or in your Outlook message store Outlook's notes, known in form language as IPM.StickyNote, are not customizable and can't be used for custom forms You can save notes to use as templates Select a form to edit or customize For this example, I'm going to choose a contact form to open (see Figure 20.4) Figure 20.4 A contact form in Design mode The first page of each of the appointment, journal, and task forms is not customizable The All Fields, Properties, and Actions tabs are not customizable on any form Editable pages have a grid to help you align the controls and page names in parentheses indicate that the page is hidden on published forms The Field Chooser lists all available fields that can be used on the forms and displays when a form opens in Design mode You can create new fields if you need them (click the New button) You won't see the picture control when you're designing a custom form but it remains on the forms unless you change the first page of a custom contact form Making any changes to the first page removes the picture control and the form reverts to the style used by Outlook 2002 and older versions If you need to add fields and want to keep the new look of the form, add the fields to another page 3 Our age form uses a TextBox to display a formula that calculates a person's age, so we need to choose the Control Toolbox button to display the controls Because I like the contact form with the picture control, I'm going to add the Age field to (P.2) When the first control is dropped on the page, the parentheses disappear Drag a Label and a TextBox control to the form These are the second and third icons in the Control Toolbox, identified by the uppercase A icon and the lowercase ab icon Right-click on the control identified as Label1 and choose Properties (see Figure 20.5) Figure 20.5 Change the properties of a control using the Properties sheet In this case, we're leaving the label named Label1 and changing the caption to Current Age You can change other properties, such as the font and colors Because this field is used as the name for the TextBox, we don't need to change anything on the other tabs Right-click on the TextBox and choose Properties Change the Name to txtAge and select the Value tab Click New to create a new field for Age, using Number for the Type: and changing Format: to All Digits (see Figure 20.6) Figure 20.6 Create a new field for displaying the age Add a check to the Set the Initial Value of This Field To: box and choose Edit Enter the formula to calculate the age (see Figure 20.7): IIf([Birthday]"None",DateDiff("yyyy",[Birthday],Date()) -IIf(DateDiff("d",CDate(Month([Birthday]) & "/" & Day([Birthday]) & "/" & 10 Year(Date())),Date())

Ngày đăng: 26/01/2014, 04:20

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan