Sunteți pe pagina 1din 9

IT Services

Microsoft Word 2007 Forms (Level 3)

Contents
Introduction ..............................................................................................................1 Creating a Form ........................................................................................................1 Setting Values for a Drop-Down List ................................................2 Turning Off Shading and Adding Formatting ...............................3 Activating the Form ................................................................................................4 Saving the Form as a Template ...........................................................................5 Checking Data Entry ...............................................................................................5 Using a Table on a Form ........................................................................................6 Fixing the Size of Boxes on a Form ....................................................7 Calculating Values on a Form ..............................................................................7 Using Macros on a Form ........................................................................................8 Exporting Data from a Form ................................................................................9

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, press <Ctrl n> for a new document 2. Type in a main heading for your form - eg Job Application

3. Change the style to [Heading 1] and [Center] it if you prefer 4. Press <Enter> 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 <Enter>) 5. Display the Developer tab by clicking on the [Office Button] then on [Word Options] and, on the Popular tab turning on the Show Developer tab in the Ribbon option click on [OK]

The Developer tab includes a Controls group, which are the keys to producing a form. The three buttons you need (text boxes, check boxes and drop-down list boxes) are all hiding in the Legacy Tools button (the one with the arrow attached, immediately above the word Controls). Dont be tempted to use the ActiveX controls or the ones shown in the Controls group these are for experts. 6. First, click on the [No Spacing] button in the Styles group on the Home tab this gives you the old normal paragraph style 7. Next, display the Ruler by clicking on the [View Ruler] button at the top of the Scroll Bar (its also on the View tab) then click on the Ruler at the 3.5cm mark to set a left tab 8. Now type in your first question (eg Name:) then press <Tab> 9. Move to the Developer tab then click on the [Legacy Tools] button in the Controls group and choose the very first tool ([Text Form Field]) - a grey box will appear ready for the user to type in his/her own name 10. Press <Enter> twice then repeat steps 8 and 9 for the second question (eg Address:) 11. Repeat step 10 for the third question (eg Date of Birth:) Next, try adding check boxes (the second button in the Legacy Tools): 12. Press <Enter> twice then type the fourth question (eg Gender:) 13. Press <Tab> then type Male followed by three spaces 14. Click on the [Legacy Tools] button then on [Check Box Form Field] (the second button in the top row) a small grey box appears 15. Press five spaces then type Female followed by three spaces 16. Repeat step 14 for a second check box Finally, add a drop-down list box (the third button in the Legacy Tools): 17. Press <Enter> twice and type the fifth question (eg Nationality:) 18. Press <Tab> then click on the [Legacy Tools] button then 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 the [Properties] button in the Controls group - a dialog box appears: Tip: You can also double click on the drop-down box to display the dialog box.

3. Type in the first Drop-down item: (eg British) - press <Enter> 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 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. 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. Repeat step 3 for a fourth list item, this time pressing the <spacebar> several times (about 10) 7. With the new entry selected, use the [Up] button to Move it to the top of the list 8. Next, click on [Add Help Text...] - another dialog box appears:

9. 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. 10. Click on [OK] to close the dialog box 11. Finally, make sure that the Drop-down enabled check box is ticked under Field settings then press <Enter> 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 at the foot of the window.

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 [Legacy Forms] button then on [Form Field Shading] - the fifth of six in the top row 3

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 select the Nationality drop-down box then right click and choose [Italic] to make it 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 Document] button towards the right of the Developer tab then choose Restrict Formatting and Editing at the top of the drop-down list a Task Pane appears on the right This is a very powerful pane and allows you to restrict both formatting and editing to different groups of users. Here isnt the place to go through this in detail; just follow the instructions below: 2. In step 2. Editing restrictions, turn on the option to Allow only this type of editing in the document 3. Using the drop-down box provided, set this to Filling in forms 4. Next, click on [Yes, Start Enforcing Protection] in step 3. Start enforcement a dialog box appears:

Theres no need to set a password at this moment, so: 5. Press <Enter> for [OK] 6. Now fill out the form, pressing <Tab> to move between the fields 7. For the Address, separate each line by a comma dont press <Enter> 8. With a check box, either type an x (or a <space>) to set/unset it, or click on it using the mouse 9. Having tested out the form, click on [Stop Protection] at the foot of the task pane on the right then click on the [Legacy Tools] button then on [Reset Form Fields] (the final button in the top row - this will clear any entries you have made) 10. End by protecting the form again - click on [Yes, Start Enforcing Protection] 11. This time type in a password of job press <Tab> 12. Type job again to confirm the password then press <Enter> for [OK] 4

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. Click on the [Office Button] and choose Save As... 2. Type in a File name: - eg Job 3. Change Save as type: to Word Document Template (*.dotx) then press <Enter> for [Save] Note that templates can be saved anywhere in Word 2007 they do not have to be saved in a special folder. 4. Click on the [Office Button] and choose New - the New Document dialog box appears 5. Under the Templates heading, choose New from exisiting... 6. Select job.dotx then press <Enter> for [Create New] for a new document based on the template 7. Fill out the form (<Tab> between fields) and 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 [Stop Protection] button 2. Type in your password job then press <Enter> for [OK] 3. Move the typing position to the Date of Birth: text form field (at 3.5cm) - just click on it 4. Click on the [Properties] button on the Developer tab The following window will appear:

5. 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. 6. Using the list arrow attached to Date format:, change this option to d MMMM yyyy 7. Press <Enter> or click on [OK] to close the Text Field Options dialog box This will automatically convert any date entered into a format showing the month and year in full (eg 25 March 2009). 5

8. Click on [Yes, Start Enforcing Protection] 9. When asked, dont bother with a password this time just press <Enter> 10. Next, press <Ctrl s> to save the changes to the template 11. Click on the [Office Button] and choose New then, under Recently Used Templates, choose job 12. Press <Enter> for [Create New] for a new document based on the template 13. Try typing help against Date of Birth then press <Tab> - an error message should appear 14. Press <Enter> to clear the message then type in a date in an abbreviated form (eg 12/5/88) then press <Tab> - it should be converted to the long format (ie 12 May 1988)

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 <Enter> 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. It's relatively simple to change the current tabdelimited 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 [Stop Protection] button to unlock the form 4. Select the questions (drag through them from the Name heading to the end of the form) 5. Move to the Insert tab, click on the [Table] button and choose Convert 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 <Enter> or click on [OK] 9. With the table still selected, click on the list arrow attached to the [Borders] button on the Table Tools Design tab and choose [No Border] 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. Move to the Table Tools Layout tab and click on [View Gridlines] 12. Click on the Name Text Box field at 3.5cm then on the [Select] button and choose Select Cell 13. Using the mouse, drag the right border in to the required width (eg to 7 cm) 14. Move to the Table Tools Design tab, click on the [Borders] button and choose [Outside Border] 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. On the Table Layout tab, click on [View Gridlines] 17. Click on [Yes, Start Enforcing Protection] 18. When asked, dont bother with a password this time just press <Enter> 19. Next press <Ctrl s> to save the template 20. Finally, create a new document based on the template, as before, 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 <Enter> instead of <Tab>. 21. [Close] your test document (there's no need to save it) and return to your template 6

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 [Stop Protection] button to unlock your form template 2. On the Table Tools Layout tab, click on [Select] then choose Select Table 3. Next, click on [Properties] then move to the Row tab The following dialog box appears:

4. Under Size turn on Specify height: and set it to 0.5 cm 5. Change Row height is: to Exactly then press <Enter> for [OK] 6. Next, click in the Address answer cell 7. Repeat steps 3 to 5 setting Specify height: to 2 cm You have now fixed the size of the rows. 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. Try it out, for practice, if you like. 8. Click on [Yes, Start Enforcing Protection] (dont set a password) then use <Ctrl s> to save the template 9. Create a new document based on the template and test out the new Address box 10. 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 [Stop Protection] button to unlock your form template 2. Click to the right of the Nationality: drop-down field, then press <Tab> for a new row 3. Press <Tab> to move to the right cell then right click and turn off [Italic] then press <Tab> again 4. In the left cell type Mileage: then press <Tab> to move to the right cell 5. Move to the Developer tab, click on [Legacy Tools] then on the [Text Form Field] button 6. Next, click on the [Properties] button and set the Type: to Number 7

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 <Enter> or click on [OK] 9. Move to the Table Tools Layout tab, click on [Select] then Select Cell 10. Adjust the cell width, set justification to [Align Right] and add an [Outside Border] 11. Press <Tab> to move to the left cell in the next row 12. Type Travel Expenses: then press <Tab> to move to the next column 13. Repeat steps 5 and 6 but this time set the Type: to Calculation 14. In the Expression: box type =Text4*0.40 (to set the mileage rate at 40p per mile) 15. Set the Number format to #,##0.00;(#,##0.00) then press <Enter> or click on [OK] - 0.00 appears in the box (the format stipulates two decimal places for the pence) 16. Click on [Yes, Start Enforcing Protection] (dont set a password) then use <Ctrl s> to save the template 17. 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 <Tab>), the Travel Expenses will be calculated. 18. 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 [Stop Protection] button to unlock your form template 2. Press <Ctrl End> then <Enter> to move to the end of the form and type Click here to email back your completed form 3. Press <Tab> then click on [Legacy Tools] then the [Check Box Form Field] button 4. Next, click on the [Record Macro] button in the Code group on the left of the Developer tab 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.dotx 7. Press <Enter> or click on [OK] 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. Click on the [Office Button] and select Send then E-mail. A prompt may come up at this point asking if you want to save as a Word Macro-Enabled Template - say No to this for now as this will be done later 9. In the To: box, type in your_own_email_address and against Subject: type Job Application 10. Click on the [Send] button to send off the form - you may be asked for your University password 11. To end the macro click on [Stop Recording] which was previously [Record Macro] 12. Now click on the [Properties] button 13. Under the heading Run macro on set Entry: to email then press <Enter> 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. On the Home tab, click on the arrow attached to the [Find] button on the far right 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 <Enter> or click on [Go To] then press <Esc> to [Close] the Find and Replace window 19. Finally, end the macro by clicking on the [Stop Recording] button on the Developer tab 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: 1. Click on the calculated Travel Expenses (which reads 0.00) then press the <End> key 2. Click on the [Legacy Tools] then on [Text Form Field] 3. Now click on [Properties] and set the Maximum length: to 1 4. Finally, set Run macro on Entry: to jump - press <Enter> or click on [OK] Now test out your macros to see what happens: 5. Click on [Yes, Start Enforcing Protection] (dont set a password) then use <Ctrl s> to save the template Youll be told that templates with macros have to be saved as .dotm files. To do this: 6. Press <Esc> or click on [No] 7. Change Save as type: to Word Macro-Enabled Template (*.dotm) then press <Enter> for [Save] 8. Create a new document based on the macro-enabled template and fill out the form 9. If the email macro recorded okay, click on the Email Check Box click on [Send a Copy] to send the form 10. Finally, [Close] your test document (don't save it) and return to your template If one of your macros 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. 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.

Exporting Data from a Form


There are two Word options which let you save or print just the data from a form. To see these: 1. Click on the [Office Button] then on [Word Options] 2. Move to the Advanced options then scroll down to Print 3. Under the When printing this document: heading note the option Print only the data from a form 4. Scroll down to Save and under Preserve fidelity when sharing this document: note the option Save form data as a delimited file (this may be greyed out on Lab PCs) 5. Only turn the print option on if it is relevant for you you may find your normal printout is affected 6. Press <Enter> for [OK] to close Word Options 7. End this session by closing any open files/templates

Trademark owned by Microsoft Corporation. Screen shot(s) reprinted by permission from Microsoft Corporation. Copyright 2009: The University of Reading Last Revised: March 2011 9

S-ar putea să vă placă și