Word Hacks [Electronic resources]

Andrew Savikas

نسخه متنی -صفحه : 162/ 103
نمايش فراداده

Hack 70 Fake (and Easy) Fill-in Forms

This hack shows you how to quickly create "click-to-replace" text in any document.

People use Word templates to store boilerplate text for letters and contracts. However, they often create novel approaches to mark the replaceable text in the template or document, as shown in Figure 8-1.

Figure 8-1. A document with text to be filled in

To remove all the brackets and keep the correct spacing in the sample agreement above requires some serious cursor gymnastics. It would be better if the person filling out the agreement could just click and type at each of the places that needed new text. You can do that with a MACROBUTTON field that runs a nonexistent macro.

Wherever you want to note an area in the text that should be filled in, do the following:

Press Ctrl-F9 to insert an empty pair of field braces.

In between the field braces, type the following:

MACROBUTTON FakeMacroName 
Text to Display

You can replace Text to Display with whatever text should appear on the page.

Press F9 to update the field.

To create field braces, you must press Ctrl-F9 or select InsertField.

Lather, rinse, and repeat for other parts of your document, which will now look more like the one shown in Figure 8-2. (Make sure you select ToolsOptions, click the View tab, and turn on field shading.)

Figure 8-2. The same document, reworked with replaceable fields

Since there is no macro called FakeMacroName, when you click the field, the entire field is selected, as shown in Figure 8-2. Just start typing to replace the field with your text.

If the text used in the field spans more than one line, Word will complain, as shown in Figure 8-3. You'll need to shorten the text in order for the field to work properly.

Figure 8-3. Word complains when the display text in a MACROBUTTON field is too long