WD: WinWord: ASK Fields with Default Answers Prompt First

ID: Q82091


The information in this article applies to:
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Microsoft Word 97 for Windows


SUMMARY

In Microsoft Word, if you supply a field as a default answer for an ASK field (by using the \d switch within the ASK field) that field is updated by an AutoNew macro before any other ASK fields in your document are updated.

This behavior can cause problems if the ASK field containing the default answer is not physically the first field in the template. If it is not the first field, the field prompts you for information twice. It is updated first and then again in order of its physical location in the template. If the prompts are answered differently, Word uses the second reply in the document.

NOTE: The use of fields as default answers to ASK fields in Word for Windows version 1.x does not cause this reaction when the AutoNew macro runs.


MORE INFORMATION

ASK fields are generally used in template files in conjunction with an AutoNew macro. When you create a new document based on such a template, the fields are automatically updated so that they prompt you for appropriate answers to be filled in at the bookmark locations.

If you use the \d switch within an ASK field to supply another field as the default answer when the prompt appears, an AutoNew macro runs on that ASK field first (regardless of its position in the document).

Steps to Reproduce Problem

  1. From the File menu, choose New, select the Template option button, and choose the OK button to create a new template file based on Normal.dot.


  2. Press CTRL+F9 to create the field braces, and insert the following fields:


  3. {ask to "Who is this memo to?"}{to}
    {ask from "Who is it from?"}{from}
    {ask today "Is today's date correct? If not, type in
    the correct date." \d {date}}{today}
    {ask hour "Time?" \d {time}}{hour}
  4. From the File menu, choose Save, type a name for the template, and choose the OK button.


  5. From the Tools menu, choose macro and record, type a name for the macro, and choose the record button. Select the Macro available To and choose the OK button. Record the following steps:


    1. From the Edit menu, choose Select All.


    2. Press the F9 key.


    3. Cancel the dialog boxes.


    4. From the tools menu, select Macro and choose Stop Recording.


  6. From the File menu, choose Close, then choose the Yes button when prompted to save changes to the template.


  7. From the File menu, choose New, select the template name assigned in step 3, select the Document option button, then choose the OK button.

    The order of prompts is as follows:
    Date
    Time
    To
    From
    Date
    Time
    In Word version 6.0, in Page Layout view, the order of prompts is:
    Date
    Time
    Date
    Time
    To
    From
    Date
    Time
    The order of prompts should be as follows:


  8. To
    From
    Date
    Time
Because the default answers to the ASK fields are reserved fields, DATE and TIME, the AutoNew macro causes them to be updated first rather than in the appropriate order.

Reference(s):

"Microsoft Word for Windows User's Guide," version 2.0, pages 646-650, 763-765, 786

Additional query words: 6.0a 2.0 2.0a 6.0 6.0c winword2 word7 word6 7.0 word95 winword word97

Keywords : kbualink97 kbusage kbfield
Version : WINDOWS:2.0,2.0a,2.0a-CD,2.0b,2.0c,6.0,6.0a,6.0c,7.0,7.0a,97
Platform : WINDOWS
Issue type :


Last Reviewed: October 6, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.