WD: "Bookmark Not Defined!" Error with Converted Hyperlink File

Last reviewed: August 15, 1997
Article ID: Q166867
The information in this article applies to:
  • Microsoft Word 97 for Windows

SYMPTOMS

If you create a document in Word 97 containing a hyperlink, save it in Rich Text Format (RTF) or in Word 6.0/95 format, and then open the saved document in Word 6.0 or Word 7.0 (95), the hyperlink fields will generate the following error message:

   Error! Bookmark not defined

This problem occurs when the fields are updated.

CAUSE

A bookmark field is created by putting "REF" followed by a bookmark name inside field braces (to create field braces, press CTRL+F9). For example, the following resembles a valid bookmark:

   {REF bookmarkname}

As a shortcut, you can type in only the bookmark name without the REF field and Word will automatically add the REF field. For example if you press CTRL+F9 and type "bookmarkname," to create the following

   {bookmarkname}

is converted to

   {REF bookmarkname}

Word 97 saves a hyperlink field just as it is. When the earlier version of Word comes across the hyperlink field, it assumes that the field is a bookmark name (because hyperlink fields did not exist in earlier versions of Word). The earlier version of Word will add the REF keyword to what it thinks is a bookmark name. Therefore, the following field

   {HYPERLINK http://www.microsoft.com}

is converted to:

   {REF HYPERLINK http://www.microsoft.com}

Because the document does not contain a bookmark called "HYPERLINK http://www.microsoft.com," it returns the "Error! Bookmark not defined" error message.

RESOLUTION

To correct this problem, install Microsoft Word 97 Service Release 1 (SR- 1). In SR-1, when you save in Word 6.0/95 (binary) format, the hyperlink field is converted to unformatted text. If you save as "Word 97 & 6.0/95 - RTF" the problem still occurs and you get an error message when the field is updated.

To work around this problem, use any of the following workarounds.

Method 1--Unlink the Fields in Word 97 Before You Save the File

You can use the following macro to unlink the hyperlink fields before saving the document in the earlier Word document format. Unlinking the hyperlink field will convert it to text and it will appear normally in the earlier version of Word.

Note, however, that unlinking the hyperlink field will mean that it no you can no longer click it to jump a location in Word 97/

For more information about converting the text back to a hyperlink, see the "More Information" section of this article.

To use this workaround, follow these steps:

  1. Open the document in Word 97

  2. Run the following macro.

       Sub RemoveHyperlinks()
          Dim oFields As Fields
          Dim oField As Field
    
          Set oFields = ActiveDocument.Fields
          For Each oField In oFields
             If oField.Type = wdFieldHyperlink Then oField.Unlink
          Next
       End Sub
    
    

  3. Save the document in the desired format (Word 6.0/95 or RTF).

Method 2--Unlink the Fields in the Earlier Version of Word

Use this method if the document has just been opened in the earlier version of Word and if no changes have been made to it yet. If you have many hyperlink fields or if you want to automate the process, use "Method 3" described later in this document.

  1. Open the document in the earlier version of Word.

  2. Press CTRL+Z on the keyboard to undo the update of the fields. (This occurs if the document is opened in page layout view.)

  3. Click a hyperlink field.

    By default, the field will appear as blue underlined text, or as "Error! Bookmark not defined."

  4. Press CTRL+SHIFT+F9 to unlink the field and convert it to text.

  5. Repeat steps 3-4 for the other hyperlink fields.

  6. Save the document.

Method 3--Run a WordBasic macro to unlink the fields

Use this method if the document contains many hyperlink fields that have been saved as Word 6.0/95 or RTF, in an earlier version of Word. This method also works well if you want to automate the unlinking of the fields. To do this, use the following steps:

  1. Open the document in the earlier version of Word.

  2. Run the following macro.

       Sub MAIN
       'This macro turns on field codes to reveal the hyperlink fields so that
       'only the hyperlink fields are unlinked. It then converts the field to a
       'quote field to make the parsing of the contents of the field easier.
       'The quote field is then updated and unlinked, leaving the text of the
       'hyperlink.
       '
       ' Go to start of document.
       StartOfDocument
       ' Turn on field codes.
       ViewFieldCodes 1
       ' Find each hyperlink field in the document.
       EditFind .Find = "^d HYPERLINK", .Direction = 0, .MatchCase = 0,
       .WholeWord
       = 0, .PatternMatch = 0, .SoundsLike = 0, .Format = 0, .Wrap = 0
       ' loop throught the document.
       While EditFindFound()
       ' If this is a Hyperlink field.
       CharLeft 1
       'convert it to a quote field
       EditReplace .Find = "HYPERLINK", .Replace = "quote", .Direction = 0,
       .MatchCase = 0, .WholeWord = 0, .PatternMatch = 0, .SoundsLike = 0,
       .ReplaceOne, .Format = 0, .Wrap = 0
       UpdateFields
       UnlinkFields
       ' Find the next field.
       CharLeft 1
       EditFind .Find = "^d HYPERLINK", .Direction = 0, .MatchCase = 0,
       .WholeWord
       = 0, .PatternMatch = 0, .SoundsLike = 0, .Format = 0, .Wrap = 0
       Wend
       'Turn off field codes
       ViewFieldCodes 0
       End Sub
    
    

  3. Save the document.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Word 97 for Windows. This problem was corrected in Microsoft Word 97 SR-1.

For additional information about SR-1, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q172475
   TITLE     : OFF97: How to Obtain and Install MS Office 97 SR-1

NOTE: When you save as Word 6.0/96 (binary) format. If you save as "Word 97 & 6.0/95 - RTF" the problem still occurs and you get an error message when the field is updated.

MORE INFORMATION

If you are using Word 97 and you receive a document from an earlier version of Word containing UNC or URL paths, you can use Word 97's autoformatting feature to convert them to hyperlinks by following these steps:

  1. Open the document in Word 97

  2. On the Format menu, click AutoFormat.

  3. Click the Options button.

  4. Click the AutoFormat tab (not the "AutoFormat as you type" tab).

  5. Clear all the check boxes except "Internet and network paths with hyperlinks" (that is, leave the "Internet and network paths with hyperlinks" check box selected).

  6. Click OK to dismiss the dialog boxes.

The AutoFormat feature will convert the paths to hyperlinks.


Additional query words: SR1 release1 8.0 8.00
Keywords : word6 word95 word97 kbinterop kbusage
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbfix kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 15, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.