Q: Userform to multiple references in document?

F

Fugubot

Hi,

I'm new to programming.

Is there a way to take a string from a Userform, assign it to a variable
and then use the REF field to repeat that string throughout a long document?

For example: Enter a Client Name in a dialog box and then have it place
in various places throughout a long document.

This may be obvious but I haven't been able to find an answer.

Greatly appreciate anyone's help.

Vern
 
D

Doug Robbins - Word MVP

In the code in the userform, use

With ActiveDocument
.Variables("varClient").Value = somecontrol.text
.Range.Fields.Update
End With

then in the document whereever you want the information to appear, insert a
{ DOCVARIABLE varClient }

--
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
 

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