Creating Forms in Microsoft Word 2003 - University of Reading



Creating Forms in Microsoft Word 2003

Introduction

A form is a special type of document in which the user can only type within certain areas. The remainder of the document is protected and cannot be modified in any way. This is precisely what is required when you want someone to fill in a questionnaire, for example. Whether the form is filled in online or printed on paper, you can arrange it so that the layout cannot be altered.

When completed online, forms allow the user to move directly between the answer boxes using the Tab key. As well as being able to type in their answers, they can also click on check boxes or select from pre-set answers provided by a drop-down list. You can also check the validity of answers and can run a macro (eg to give additional instructions) on entering a box or on leaving it.

Creating a Form

Start your form on a new blank document:

1. Start up Microsoft Word or, if Word is already running, click on the [New] toolbar button

2. Type in a main heading for your form - eg Job Application

3. Using the [Style] button, change the style to Heading 1 and [Center] it if you prefer

4. Press twice then type the instructions for completing the form - eg Please fill in the form below, clicking on the option boxes or using the drop-down lists where these are provided. (press twice)

5. Display the Forms toolbar by opening the View menu, selecting Toolbars then Forms

[pic]

The Forms Toolbar is the key to producing a form. The three buttons on the left allow you to add text boxes, check boxes and drop-down lists boxes to your document. Try these out next:

6. Before you start, click once on the Ruler at the 3.5cm mark to set a left tab

7. Type your first question (eg Name:) then press

8. Now click on the first button on the Forms toolbar ([Text Form Field]) - a grey box will appear ready for the user to type in his/her own name

9. Press twice then repeat steps 7 and 8 for the second question (eg Address:)

10. Repeat step 9 for the third question (eg Date of Birth:)

Next, try adding check boxes (the second button on the Forms toolbar):

11. Press twice then type the fourth question (eg Gender:)

12. Press then type Male followed by three spaces

13. Click on [Check Box Form Field] (the second button) - a small grey box appears

14. Press five spaces then type Female followed by three spaces

15. Repeat step 13 for a second check box

Finally, add a drop-down list box (the third button on the Forms toolbar):

16. Press twice and type the fifth question (eg Nationality:)

17. Press then click on [Drop-Down Form Field] (third button) - another box appears

Note: Drop-down lists are only of use on a form which is being filled in online.

Setting Values for a Drop-Down List

To set the values you want to appear in the drop-down field:

1. Make sure the current typing position is against the drop-down box (it should already be so)

2. Click on [Form Field Options] (the fourth button on the toolbar) - a dialog box appears:

[pic]

3. Type in the first Drop-down item: (eg British) - press or click on [Add►►]

4. Repeat step 3 for the second list item - eg European Community

5. Repeat step 3 for the third list item - eg Other

Note that you can amend the list order by first selecting a list item and then using the Move arrows. A selected item can also be deleted from the list using the [Remove] button.

6. Click on [Add Help Text...] - another dialog box appears:

[pic]

7. Select the option Type your own: then type the following message in the box provided: Click on the list arrow then select your answer from those provided.

8. Click on [OK] to close the dialog box

9. Finally, make sure that the Drop-down enabled check box is ticked under Field settings then press or click on [OK]

You have now created your drop-down list. Anyone filling out the form online must select from this list - they cannot type in another value. The help message will be displayed on the Status Line.

Tip: The first item in a drop-down list appears as the default value. If you want to display an empty box, create an extra blank list item as the first entry in the list. You must type at least one character to create the list item (eg a space). Use several spaces to widen the box.

Turning Off Shading and Adding Formatting

Currently the boxes are all shaded grey. If the form is being filled in online then the shading is unnecessary; even for a printed form, it's better to provide an outlined box. It's very easy to turn off the shading:

1. Click on the [Form Field Shading] button - the already highlighted one on the Forms toolbar

The grey shading should now have disappeared. To turn it on again (if you prefer that) simply click on the [Form Field Shading] a second time.

To add a format to an answer field:

2. Select the form field to be formatted then apply the formatting - eg click on the [Italic] button to make the Nationality drop-down box italic

Other formatting you might want to change includes the font (and font size) and justification (eg in a table, you might want numbers to line up on the right).

Activating the Form

Though you created a drop-down list, the form is not yet activated and so the list items do not show. A form becomes active once it has been protected. You can then only type in the form fields themselves and cannot make any changes to the existing text:

1. Click on the [Protect Form] button on the far right of the Forms toolbar

You should find that the drop-down list arrow now appears.

2. Select a value from the drop-down list then press

You'll find you jump straight to the first (Name) question on your form.

3. Fill out the form, pressing each time to move between the fields

4. When typing in your Address separate each line by a comma - do not press

5. With a check box, either type an x (a unsets it) or click on it using the mouse

6. Having tested out the form, click on the [Protect Form] then [Reset Form Fields] (immediately to the left) buttons - this will clear any entries you have made

7. End by protecting the form again - click on [Protect Form]

8.

Saving the Form as a Template

Forms are usually saved as templates so that each user creates a new document based on the template with all the boxes empty and waiting to be filled in. To create a template:

1. Open the File menu and choose Save As...

2. Type in a File name: - eg Job

3. Change Save as type: to Document Template (*.dot)

4. Press or click on [Save]

Note that templates are saved in a special folder under My Documents. When you ask for a new document, Word checks in this folder to see what templates you may have created:

4. Open the File menu and choose New... - the Task Pane appears

5. Under the Templates heading, choose On my computer...

6. Select Job.dot then press for [OK] to create a new document based on the template

7. Fill out the form ( between fields) but note that you cannot edit the existing text

8. When you have finished, [Close] the document - there's no need to Save it

You should now have returned to your template, ready to make further amendments.

Checking Data Entry

You can check for valid data entry in a Text Field and can specify how you want the data to appear on the form. On the current form, for example, you can check that a date is being entered against Date of Birth:

1. First you need to unprotect the form - click on the [Protect Form] button

2. Move the typing position to the Date of Birth: text form field (at 3.5cm) - just click on it

3. Click on the [Form Field Options] button - the fourth on the Forms toolbar

The following window will appear:

[pic]

4. Using the list arrow attached to Type:, change this option to Date

Note the other available types - you can restrict entry to numbers, for example, or can automatically set this to pick up the current date or time.

5. Using the list arrow attached to Date format:, change this option to d MMMM yyyy

6. Press or click on [OK] to close the Text Field Options window

This will automatically convert any date entered into a format showing the month and year in full (eg 25 January 2003).

7. Click on the [Protect Form] button then press to save the changes to the template

8. Open the File menu and choose New...

9. Click on the link to the Job.dot template in the Task Pane (under Recently used templates)

10. Try typing help against Date of Birth then press - an error message should appear

11. Press to clear the message then type in a date in an abbreviated form (eg 12/5/82) then press - it should be converted to the long format (ie 12 May 1982)

Using a Table on a Form

Using tabs to line up the boxes on a form works well, except where the answer stretches over more than a single line. To see what happens:

1. Move to the Address field and type in your address - press at the end of each line

You will find that the second line begins on the far left of the form. To overcome this a table can be used. Some people always use a table to lay out their forms and both the [Draw Table] and [Insert Table] buttons are provided on the Forms toolbar. It's relatively simple to change the current tab-delimited form into a table; there's no need to start again from scratch.

2. First, [Close] the current document (there's no need to Save it) to return to your template

3. Click on the [Protect Form] button to unlock the form

4. Select the questions (drag through them from the Name heading to the end of the form)

5. Open the Table menu and choose Convert then Text to Table...

6. Under Separate text at choose the option Tabs

7. Check that the Number of columns: (under Table size) is set to 2

8. Press or click on [OK]

9. With the table still selected, click on the list arrow attached to the [Borders] button on the Formatting (lower main) toolbar and choose [No Border] (second icon, bottom row)

10. Click anywhere within the table to release the selection highlighting

Having removed all the borders from the form, you might want to reinstate some - especially if the form is to be printed out on paper. First, it's a good idea to display the gridlines and set the required box width.

11. Open the Table menu and select Show Gridlines

12. Click on the Name Text Box field at 3.5cm then open the Table menu and choose Select then Cell

13. Using the mouse, drag the right border in to the required width (eg to 7 cm)

14. Click on the [Borders] button list arrow and choose [Outside Border] (first icon, top row)

15. Repeat steps 12 to 14 for the Address and Date of Birth answer boxes

Once you have set up the answer box borders, you can remove the table gridlines:

16. Open the Table menu and select Hide Gridlines

17. Click on the [Protect Form] button then press to save your template

18. Finally, create a new document based on the template and test out the new layout

You will find when you enter your Address the box expands with each line under the previous one. The same would happen with any of the other text boxes if someone accidentally presses instead of .

19. [Close] your test document (there's no need to save it) and return to your template

Fixing the Size of Boxes on a Form

There's nothing more frustrating with online forms than the boxes growing in size as you type. The form then no longer fits correctly on paper if it is printed out. 

The problem is usually caused by the creator of the form pressing the Enter key to define the height of the box. They should have used the following method instead:

1. Click on the [Protect Form] button to unlock your form template

2. Click on the Address answer cell

3. Open the Table menu, select Table Properties... then click on the Row tab

The following window will appear:

[pic]

4. Under Size turn on Specify height: and set it to 2 cm

5. Change Row height is: to Exactly

6. Press or click on [OK]

You have now fixed the size of the row. Use the alternative Row height is: setting of At least if you want a box with a minimum size. When printed on paper this will be of a fixed size, but when used online, it can expand if necessary. Ideally you should fix the row height of all the rows in the table to stop them growing by accident - do so for practice, if you like.

7. Click on the [Protect Form] button then press to save the template

8. Create a new document based on the template and test out the new Address box

9. Finally, [Close] your test document (don't save it) and return to your template

Calculating Values on a Form

Forms are often used for submitting expenses. It's very easy to perform simple calculations on data entered into the form:

1. Click on the [Protect Form] button to unlock your form template

2. Click to the right of the Nationality: drop-down field, then press for a new row

3. Press  to move to the right cell, turn off [Italic] then press again

4. In the left cell type Mileage: then press to move to the right cell

5. Click on the [Text Form Field] button

6. Next, click on the [Form Field Options] button and set the Type: to Number

7. Under Field settings: make note of the Bookmark: (Text4) then turn on Calculate on exit:

This Bookmark is important - it's the name you must use to reference the contents of the cell in any calculation. The Calculate on exit option will activate any formulae in which this bookmark is used.

8. Press or click on [OK]

9. Set justification to [Align Right] then add an [Outside Border] and adjust the cell width

10. Press to move to the left cell in the next row

11. Type Travel Expenses: then press to move to the next column

12. Repeat steps 5 and 6 but this time set the Type: to Calculation

13. In the Expression: box type =Text4*0.40 (to set the mileage rate at 40p per mile)

14. Set the Number format to £#,##0.00;(£#,##0.00) then press or click on [OK]

15. Click on the [Protect Form] button then press to save the template

16. Create a new document based on the template and test out the new field

You should find that after you enter some data into the Mileage box (press ), the Travel Expenses will be calculated.

17. Finally, [Close] your test document (don't save it) and return to your template

Tip: To refer to several boxes in a formula separate them by commas (eg =sum(Text1, Text2, Text4)). You can also refer to a column of boxes as above (eg =sum(above) or =average(above)).

Using Macros on a Form

You've just seen how calculations can be performed automatically as data is entered. You can in fact create your own macro which runs either on entry to a field or as you leave it. The last addition you are going to make to your form is to create a macro to email the form back to you.

1. Click on the [Protect Form] button to unlock your form template

2. Press  then  to move to the end of the form and type Click here to email back your completed form

3. Press then click on the [Check Box Form Field] button

4. Next, open the Tools menu and select Macro followed by Record New Macro...

5. Type email as the Macro name: (there's no need to assign it to the toolbar or keyboard)

6. Change Store macro in: to Documents Based On Job.dot

7. Press or click on [OK] - DO NOT CLOSE THE FLOATING TOOLBAR

If you have never created a macro before then the next few steps will be something of a mystery - just follow the instructions carefully. You have just started up the Macro Recorder; this records any commands you now use or keystrokes you press, which then form the macro.

8. Open the File menu and select Send To then Mail Recipient (as Attachment)... (or just Mail Recipient if this command isn't shown)

9. In the To: box, type in your_own_email_address and against Subject: type Job Application

10. Click on the [Send a Copy] button to send off the form

11. To end the macro click on [Stop Recording] - the left button on the floating Stop toolbar

12. Now click on the [Form Field Options] button

13. Under the heading Run macro on set Entry: to email then press for [OK]

Next, you need another macro to make sure someone doesn't accidentally send off an incomplete form:

14. Repeat steps 4 to 7, calling your second new macro jump

15. Open the Edit menu and choose Go To...

16. On the Go To tab, set Go to what: to Bookmark

17. Under Enter bookmark name:, click on the list arrow and select Text1

18. Press or click on [Go To] then [Close] the Find and Replace window

19. Finally, end the macro by clicking on the [Stop Recording] button

The final step is to add this macro to the last field in the table. Sadly, you can't add a macro to a form field which is used in a calculation, so you need to add another dummy field first:

20. Click on the calculated Travel Expenses (which reads £0.00) then press the  key

21. Click on [Text Form Field] then on [Form Field Options] and set the Maximum length: to 1

22. Finally, set Run macro on Entry: to jump - press  or click on [OK]

Now test out your macros to see what happens:

23. Click on the [Protect Form] button then press to save the template

24. Create a new document based on the template and fill out the form

25. Click on the Email Check Box then on the [Send a Copy] button (if you don't want to send it, click on the [E-mail] button on the left of the Standard toolbar)

26. Finally, [Close] your test document (don't save it) and return to your template

If the macro didn't work it's easiest to record it again. Note that you can't record a click on the [Send a Copy] button because it's a mailer, not Word, command. To get this working you would need to write some very clever instructions in the Visual Basic editor.

IMPORTANT: If you use Mail Recipient rather than Mail Recipient as Attachment, any data held in fields which aren't text fields is lost. Only use text fields on your forms if this is the case.

Note also: Special instructions are needed to create forms for use on the web - see the document Forms and cgi scripts on the WWW for further details.

Protecting a Form

Though you have already protected your form, anyone with a good knowledge of Word could easily unprotect it. To make certain this doesn't happen you need to password protect it. To do this:

1. Click on the [Protect Form] button to unlock your form template

2. Now open the Tools menu and select Protect Document... - a Task Pane appears

3. Under 2. Editing restrictions turn on the Allow only this type of editing in the document check box then choose Filling in Forms from the list provided

4. Under step 3. Start enforcement, click on [Yes, Start Enforcing Protection] 

The following window appears:

[pic]

5. Against Enter new password (optional): type in a password - eg job

6. Reenter password to confirm: then press or click on [OK]

7. Press to save the template - note that Protect Form is already on

8. Create a new document based on the template and try unlocking the form - ie click on the [Protect Form] button - the following screen appears:

[pic]

If you were not the creator of the form, you would not know the password and so would not be able to unlock it.

8. Click on [Cancel] then [Close] the new document - there's no need to save it

9. Click on the [Protect Form] button to redisplay the Unprotect Document window

10. This time, type in the password (ie job) - to unlock the template

11. Press or click on [OK]

12. Click on the [Protect Form] button to lock the template (without the password)

13. Finally, press to save the template then [Close] it

14. End by closing the Forms toolbar - click on it's [Close] button

Note: You can also unprotect a document from the Tools menu using the Unprotect Document command.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download