Can a macro be assined to create a cross reference to a bookmark?

  • Thread starter Thread starter gremillion1
  • Start date Start date
G

gremillion1

I need to create several cross references to bookmarks in a fillable form.
Instead of selecting Insert > Reference> Cross reference > Bookmark
everytime, can I create a macro to do these steps for me, and then manually
select the bookmark?
 
The following works for me in Word 2003 and should also work in most earlier
versions:

Sub InsertXRef
Dialogs(wdDialogInsertCrossReference).Show
End Sub

Where you place this code is a matter of choice and depends on the context
in which you want this macro to be available. If you want to use it in any
document you create, add it to the Normal template (or to a template saved in
Word's Startup folder). If you want it only for specific documents, put it in
the template on which those specific types of document are based - assuming
that they are based on a certain template and not just the Normal.

You can also assign this macro to a button on a custom toolbar or one that
you add to a built-in toolbar. The process for doing this is covered in the
Word Help topics on macros.
--
Cheers!

Gordon Bentley-Mix
Word MVP

Please post all follow-ups to the newsgroup.

Read the original version of this post in the Office Discussion Groups - no
membership required!
 
In addition to Gordon's comments, you can also assign a keyboard shortcut to
active the Insert Crossreference dialog. So if you don't like/know macros
this is another option.
Hope the helps
DeanH
 
Back
Top