The Ask field code causes Word to prompt you to enter information, which it then assigns to a named variable, called a bookmark.
A field codetells Word what to insert or provide to the document after determining the value of the field code, such as the current date or the number of pages. Usually, the resulting value is simply displayed as part of the document. You can toggle between viewing the result or viewing the field code by pressing Alt+F9 on Windows or fn+Option+F9 on Mac.
You can use the Ask field in a document or as part of a mail merge. Word prompts you for a response each time you update the Ask field, or when you step through the records in a mail merge. To display the response in the content of the document, you must insert a Ref field after the Ask field.
Tip:Â One way to update a field is to select it, and then, on Windows, press F9 or, on Mac, press Shift+Option++U.
In this topic:
Syntax
When you view the Ask field code in your document, the syntax looks like this:
{ ASK Bookmark"Prompt" [Optional switches ] }
Instructions
Bookmark
The bookmark name assigned to the response to the prompt, for example, ClientName.
"Prompt"
Prompt text, which is displayed in a dialog box — for example, "Enter the client's name."
Optional switches
\d "Default "
Specifies a default response if you don't type a response in the prompt dialog box. For example, the field
{ ASK Typist "Enter typist's initials:" \d "tds" } assigns "tds" to the bookmark Typist if you don't enter a response.
If you don't specify a default response, Word uses the last response that was entered. To specify a blank entry as the default, type empty quotation marks after the switch. For example, type \d "" .
\o
When used in a mail merge main document, displays the prompt one time instead of each time you merge a new data record. The same response is inserted in each resulting merged document.
Example
The following example describes a report form that asks for the month of the report and then automatically displays the answer in various places in the report.
-
An Ask field with a bookmark of MonthReport and prompt of What month is this report for? has been inserted near the beginning of the document.
-
The month name occurs several places in the document. A Ref field that specifies the MonthReport bookmark has been inserted in each of these places.
-
If you perform a mail merge or update the field, Word displays the prompt specified in the field code and accepts entry of text. In this example, the user typed August in response to the prompt.
-
Each of the Ref fields is updated with the content of the MonthReport bookmark: in this example, August.
Use the Ask field in a document
To use the Ask field in a document, do the following:
-
On the Insert tab, in the Text group, click Quick Parts, and then click Field.
-
In the Field names list, select Ask.
-
In the Prompt box, type the question that you want answered.
-
In the Bookmark name box, type a name for the bookmark that will store the response to the prompt.
-
If you want a predefined response, select the Default response to prompt check box, and type the text.
-
If you want the same response to apply to all the records in a mail merge, select the Prompt before merging bookmark text check box. Otherwise, Word will prompt you for a response with each record.
-
Click OK.
Use the Ask field in mail merge
To use the Ask field as part of a mail merge, do the following while you are setting up the mail merge:
-
On the Mailings tab, in the Write & Insert Fields group, click Rules, and then click Ask.
-
In the Bookmark box, type a name for the bookmark that will store the response to the prompt.
-
In the Prompt box, type the question you want answered.
-
If you want a predefined response, type the response in the Default bookmark text box.
-
If you want the same response to apply to all the records in the merge, select the Ask once check box. Otherwise, Word will prompt you for a response with each record.
Insert a Ref field to display the value saved by the Ask field
To insert a Ref field for displaying the content of a bookmark, do the following:
-
Place the insertion point in the document after the ASK field.
-
On the Insert tab, in the Text group, click Quick Parts, and then click Field.
-
In the Field names list, select Ref.
-
In the Bookmark name list, select the name of the bookmark that is defined in the ASK field.
-
Click OK.