2 Useful Ways to Prevent Reference Errors Caused by Changing Bookmark Text

In this article, we would like to show you 2 useful ways to prevent reference errors caused by changing bookmark text.

Accidental Deletion of Bookmark Causing Reference Errors

Now and then, when drafting a Word document, we often insert bookmark and use cross-reference to quickly jump to a specific location. Now here is today’s issue. If we change the text of a bookmark which has been cross-referenced, and update the reference field, we often encounter with an error message, such as bellow:Error message

Why would it happen? The very answer is we are likely to accidentally delete the original bookmark field. Because we usually only select the texts we need, excluding the spaces before and after, to set it as bookmark, we are easily to delete the field when we select the texts again as to change contents. The bookmark field is replaced with a plain text. And with bookmark nowhere to find, the reference surely cannot be updated. Then here goes the updating error.

Thus, here are 2 workarounds.

Method 1: Replace Bookmark Text inside its Field

  1. In case you get lost with too many bookmarks, here we use the “Go To” function to locate the target bookmark. Click “Home” then the arrow button next to the “Find”. Then choose “Go To” to open “Find and Replace” dialog box.Click "Home"->Click the Arrow Button behind "Find"->Click "Go To"
  2. Now select “Bookmark” and choose a bookmark then click “Go To”.Choose "Bookmark"->Select bookmark->Click "Go To"
  3. Next put cursor inside the bookmark text to enter new contents there. After this, delete the original text.
  4. Then press “Ctrl+ A” to select the entire document and press “F9” to update references.

Method 2: Run Word Macro

  1. Firstly, press “Alt+ F11” to trigger the VBA editor.
  2. Secondly, click “Normal” and then “Insert” tab.
  3. Choose “Module” to insert a new one under “Normal” project.Click "Normal"->Click "Insert"->Click "Module"
  4. Next double click to bring out the coding area on the right side and paste the following macro:
Sub ChangeTheBookMarkTextAndUpdateCrossReference()
  Dim strBookMarkName As String
  Dim strNewText As String
  Dim objBookMarkRange As Range
  '  Input the bookmark name and text that you want to change. 
  strBookMarkName = InputBox("Enter the bookmark name which you want to change it's text", "BookMark Name", "For example: DWORDR")
  strNewText = InputBox("Enter the bookmark text which you want to change", "New Bookmark Text", "For example: New text")
  With ActiveDocument
    If .Bookmarks.Exists(strBookMarkName) Then
      Set objBookMarkRange = .Bookmarks(strBookMarkName).Range
      objBookMarkRange.Text = strNewText
      .Bookmarks.Add Name:=strBookMarkName, Range:=objBookMarkRange
      MsgBox ("The Bookmark: " & strBookMarkName & " is not founded.")
    End If
  End With
  Set objBookMarkRange = Nothing
End Sub
  1. Now click “Run”.Paste Codes->Click "Run"
  2. In the first box popping up, enter bookmark name and click “OK”.Enter Bookmark Name
  3. Next enter new bookmark text in the second box and click “OK” finally.Enter New Bookmark Text->Click "OK"

Method 2 can bypass the awkwardness of unintentionally delete bookmark field.

Handle Word Errors

The versatility use of Word makes it one of the most popular products. Then there is also the necessity to get a tool to recover Word in case it fails. If we don’t handle the problem as soon as possible, more Word documents can get corrupted.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including xlsx recovery and pdf repair software products. For more information visit www.datanumen.com

Comments are closed.