Err Msg in Place of REF Field Result: Bookmark Not DefinedLast reviewed: February 5, 1998Article ID: Q98895 |
The information in this article applies to:
SUMMARYIf you type nothing in response to an ASK field prompt, Word for Windows records a null value, which may result in one of the following error message to appear as the result of the REF field that references the empty ASK field result:
Word 1.x and 2.x: Error! Bookmark not defined.Word 6.x, 7.x, and 97: Error! Reference source not found. This happens because you cannot assign a bookmark to a null value. A bookmark must represent a value, such as a selection or the insertion point (the insertion point is not the same as a null value).
Workaround 1To prevent the above error message from appearing, insert a SET field before the ASK field, as shown in the example below. The SET field assigns the insertion point, or no selection (""), to the bookmark (instead of a null value) so the error message does not occur.
{SET address2 ""}{ASK address2 "What is the second line of the address?"}{REF address2}This workaround assigns a blank value to the bookmark that Word can insert if a different value is not later assigned using the ASK field. NOTE: The \d (default) ASK field switch has no effect on this workaround.
Workaround 2Insert an IF field that compares the reference to the ASK field bookmark with a reference to an intentionally undefined bookmark. If the bookmarks are the same (which means that both produce the error message), Word inserts an alternate result. NOTE: Be sure to choose a unique bookmark name as the intentionally undefined bookmark. If this bookmark name is later assigned to a value, the workaround fails. In the following example, which illustrates this workaround, "xxxx" is an undefined bookmark name. If the value of the mybkmark bookmark is null, Word inserts "No name given" as the result of the IF field.
{ASK mybkmark "Type your name:"}Insert the following IF field in place of the REF field that references the ASK bookmark results:
{IF {mybkmark} = {xxxx} "No name given" {mybkmark}}Reference(s): "User's Guide," version 2.0, pages 477-478, 640-644, 646-650
|
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |