Mail Merge "Ask for Text" Codes
The mail merge Ask / Ref field code combination is a handy way to ask for a typed response, then place that response at one or more locations in a merge document, or to use that response in a conditional statement. When you generate a document that has Ask / Ref codes, the merge will stop and prompt you to enter unique text. You can then either print that text in one or more locations in the document, or use it to test conditional statements. The response you type is not saved: It is used only for the current merging job.
Ask / Ref Codes vs Fill In Codes
With Ask/Ref codes, you are prompted for an ad hoc response when the document is merged, and that response can be used as many times as needed throughout that document. With Fill In codes, you are prompted for an ad hoc response as the document is merged, and your response is used only at that point in the document. This topic describes Ask/Ref codes. See "Mail Merge "Fill In"
(Ad Hoc) Variables" for details about that type of code.
Select Editors from the Tools section of the Home ribbon bar. Then, from the General section, open the Mail Merge Documents editor. (You can also use the Search field to look for the editor you want to work with.)
Open your Mail Merge Documents editor, then choose an existing document and click Open, or click New to create a new document. You can create documents with either Microsoft Word or with HTML. Existing documents created in Word are preceded by the
Word icon. HTML documents are indicated with your primary browser icon (i.e.
).
-
Position Your Cursor
Place your cursor in the document where you want the information to print.
-
Open "Field" Menu
Open the Field option from the Insert menu bar of your Word window.
Word 2002/2003
- Click the Insert menu and select Field. (No illustration available.)
Word 2007 or greater
- Click the Insert ribbon bar, and select Quick Parts. Then choose the Field option.
-
Insert "Ask" Code
Select Mail Merge in the Category box, and choose the Ask field name option. Click Ok to accept your choice and insert the code into your document. (If you wish, consult your Word documentation for details about setting up other "switches" for this type of code.)
If you do not see the merge code, or if you see an error, press Alt+F9 to toggle the merge code display.
-
Remove Extraneous Code
Remove \*MERGEFORMAT from the code. The code will now look like this: {ASK}
-
Name Your Bookmark (Variable)
Position your cursor at the space after the ASK, but inside the braces, and type a bookmark name for this information. Do not enclose the bookmark in quotation marks. The code will now look something like this:
-
Insert the Prompt to Show
Position your cursor at the space after the bookmark name, but inside the braces, and type the prompt you want to appear when merging the letter. Enclose the prompt in quotation marks. The code will now look something like this:
{ASK DOG "What is {MERGEFIELD Patient_Full_Name}'s dog's name?" }
-
Insert Optional Default Response
If the user leaves the prompt blank as the document merges, you can choose to either print nothing, or print a default response.
To print nothing if the prompt is left blank, type /d "" after the prompt in your code: {ASK DOG "What is {MERGEFIELD Patient_Full_Name}'s dog's name?" /d""}
To print a default response if the prompt is left blank, type /d"" after the prompt in your code, then type your response inside the quotation marks. In this example, your pet is the default response: {ASK DOG "What is {MERGEFIELD Patient_Full_Name}'s dog's name?" /d"your pet"}
After you create your bookmark and prompt, you can use that bookmark anywhere in the document just like a regular variable. The response the user types as the document merges, or your default response if the user leaves the prompt blank, will print wherever you insert the bookmark reference.
-
Insert a "Ref" Code
Position your cursor where you want the response appear, and open the Field window again, as described at the beginning of these instructions. Under Categories, select Links and References. Under Field Names, select Ref. Click Ok to accept your choice.
-
Reference Your Bookmark
Position your cursor at the space after the REF, but inside the braces, and type your bookmark name. Do not enclose the bookmark in quotation marks. You may repeat this process to insert the REF code anywhere within the document, just as you would insert regular mail merge variables. You may even use the REF code inside other ASK codes, and within IF statements to further personalize your documents.
We hope you will bring {REF DOG} with you to our Dogs Smile! event on Saturday.
Click the X in the upper right corner of the document window. As you exit, you have the opportunity to save the document.