Documente Academic
Documente Profesional
Documente Cultură
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.
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.
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).
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
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)
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
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)).
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.
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