Field codes: Ask field

The Ask field code prompts you to enter information and assigns your response to a named variable, called a bookmark. For the information to appear in the document, you must insert a Ref field (field: A set of codes that instructs Microsoft Word to insert text, graphics, page numbers, and other material into a document automatically. For example, the DATE field inserts the current date.) that refers to the bookmark. Word prompts you for a response each time you update the Ask field, such as when you press F9 or step through the records in a mail merge.

You can use the Ask field in a document or as part of a mail merge. To display the response in the content of the document, you must insert a Ref field after the Ask field.

To use the Ask field in a document, do the following:

  1. On the Insert tab, in the Text group, click Quick Parts, and then click Field.
  1. In the Field names list, select Ask.
  2. In the Prompt box, type the question that you want answered.
  3. In the Bookmark name box, type a name for the bookmark that will store the response to the prompt.
  4. If you want a predefined response, select the Default response to prompt check box, and type the text.
  5. 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.
  6. Click OK.

To use the Ask field as part of a mail merge, do the following while you are setting up the mail merge:

  1. On the Mailings tab, in the Write & Insert Fields group, click Rules, and then click Ask.
  1. In the Bookmark box, type a name for the bookmark that will store the response to the prompt.
  2. In the Prompt box, type the question you want answered.
  3. If you want a predefined response, type the response in the Default bookmark text box.
  4. 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.

To insert a Ref field for displaying the content of a bookmark, do the following:

  1. Place the insertion point in the document after the ASK field.
  2. On the Insert tab, in the Text group, click Quick Parts, and then click Field.
  1. In the Field names list, select Ref.
  2. In the Bookmark name list, select the name of the bookmark that is defined in the ASK field.
  3. Click OK.

Syntax

When you view the Ask field code in your document, the syntax looks like this:

{ ASK Bookmark "Prompt " [Optional switches ] }

 Note    A field code tells the field what to show. Field results are what is shown in the document after having evaluated the field code. To toggle between viewing the field code and the field code results, press Alt+F9.

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

ASK field in action

Callout 1 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.
Callout 2 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.
Callout 3 If you perform a mail merge or press F9 while the Ask field is selected, Word displays the prompt. In this example, the user typed August in response to the prompt.
Callout 4 Each of the REF fields is updated with the content of the MonthReport bookmark: in this example, August.

Top of Page Top of Page

 
 
Applies to:
Word 2013, Word 2010, Word 2007