cross referencing to insert txt in multiple places

M

Michelle

I know that this question has been asked before and I have tried the answers
given but I still cannot get my cross references to work!

I have set up a UserForm following the instructions in MVPS Create a
UserForm. my bookmarks and textboxes work fine. Then, to get the same info
in one bookmark to appear elsewhere in the document I insert a cross
reference as follows;
Ref Type: Bookmark
Insert Ref To: Bookmark Text
For which bookmark: I select the name of the bookmark (ContractorShortName)

But all that happens is Word puts the reference data in as {REF
ContractorShortName} instead of the actual text entered eg. Smithers & Sons.

I am only begining, just following the responses to other peoples questions.
Can someone please tell me what I am doing wrong? I am using XP.
 
D

Doug Robbins - Word MVP

Press Alt+F9 to toggle off the display of the field codes.

Alternatively, instead of using the code to insert the data into the .Range
of bookmarks, use

With ActiveDocument
.Variables("varContractorShortName").Value = txtContractorShortName
.Range.Fields.Update
End With

in the user form and in the template insert { DOCVARIABLE
varContractorShortName } fields in each location where you want that data to
appear.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
M

Michelle

Many thanks Doug, you have saved the day!

It didn't work with the DocVariable field but it did when I inserted a Ref
field instead, but I had to leave the lines you provided in visual basic.
The Ref field wouldn't work when I took those lines out.

I don't know why it works but it does, so thank you. You have saved my
computer from a short flight out of a small window!

Michelle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top