Use Word Bookmark Cross-References in Excel VBA
Question details
Use Excel VBA to populate a Word bookmark and display its text in multiple locations.

- Product
- Microsoft Word and Excel VBA
- Device & OS
- not provided
- Scenario
- An Excel VBA macro fills predefined bookmarks in a Word document, and some values need to appear more than once.
- Observed behavior
- Text inserted into a bookmark appears at its single bookmarked location; other locations need cross-reference fields to display the same text.
Open the target Word document and confirm that it contains the bookmark name your macro will use. If you use the VBA example below, make the document active in Word and enable the Microsoft Word Object Library in the Excel VBA editor.
Insert a Word bookmark cross-reference with Excel VBA
Use this method to populate a source bookmark and insert its text as a cross-reference elsewhere in the active Word document.
A bookmark name identifies one location. A cross-reference field displays the text of that bookmark at another location; update the field after changing the source text.
Replacing a bookmark's range text can remove the bookmark, so the example recreates it around the new text before inserting the cross-reference.
In Excel, open the VBA editor with Alt+F11, choose Tools > References, and select Microsoft Word Object Library.
In the VBA editor, choose Insert > Module and paste this example. Replace the bookmark name and value as needed: Sub InsertBookmarkReference() Dim wordApp As Word.Application Dim doc As Word.Document Dim sourceRange As Word.Range Dim targetRange As Word.Range Set wordApp = GetObject(, "Word.Application") Set doc = wordApp.ActiveDocument Set sourceRange = doc.Bookmarks("Entity_legal_name").Range sourceRange.Text = "Example Company LLC" doc.Bookmarks.Add Name:="Entity_legal_name", Range:=sourceRange Set targetRange = doc.Range(doc.Content.End - 1, doc.Content.End - 1) targetRange.InsertCrossReference ReferenceType:="Bookmark", _ ReferenceKind:=wdContentText, _ ReferenceItem:="Entity_legal_name", _ InsertAsHyperlink:=True doc.Fields.Update End Sub
With the target document active in Word, run InsertBookmarkReference from the Excel VBA editor. The example inserts the reference at the end of the document; change targetRange to another Word range to place it elsewhere.

Insert a bookmark cross-reference manually in Word
Use Word's cross-reference dialog to add a repeated value without writing a macro.
Edit Word Documents with WPS Office
WPS Office is a free, lightweight alternative for editing documents and spreadsheets. Its familiar interface and Microsoft Office format compatibility make it easier to move existing files into a new workflow. Microsoft Word's VBA cross-reference automation still requires Word.

Frequently Asked Questions
Can the same Word bookmark name exist in several places?
No. A bookmark name identifies one location in a document. Insert cross-reference fields to show the bookmark's text at other locations.
Why did my bookmark disappear after my VBA macro inserted text?
Assigning text to a bookmark's Range can remove the bookmark. Keep the range in a variable, assign its Text, and use doc.Bookmarks.Add with the same name and range to recreate it.
How do I update a cross-reference after changing the source text?
In Word, right-click the cross-reference and choose Update Field. To update fields in the main document body, press Ctrl+A and then F9.
Can a bookmark cross-reference be clickable?
Yes. In VBA, set InsertAsHyperlink:=True when calling Range.InsertCrossReference. In Word's Cross-reference dialog, select the option to insert the reference as a hyperlink.
Where does the VBA example insert the repeated text?
It inserts the cross-reference at the end of the active Word document. Set targetRange to the desired Word range before calling InsertCrossReference to use a different location.




