Variable Use in Multiple Documents

D

Denise

I have several documents that list the same information, such as the current
amount for monthly dues to our cabana club. Every time the dues change,
someone has to edit each document to change the amount. I would like to
create a variable and set the value in one place, but use the variable in
multiple documents. It looks like I might be able to do this with a doc
variable. But I don't quite understand how to do it. I see thread with the
subject Set Variable in VBA, use in document, dated 11/29/2005, which talks
about it. My problem is I don't know where to create the variable in the
first place. Do I do it right in my Word document, or do I do it somewhere
else? Also, how do I make it so the variable can be used in multiple
documents?
 
J

Jay Freedman

Denise said:
I have several documents that list the same information, such as the
current amount for monthly dues to our cabana club. Every time the
dues change, someone has to edit each document to change the amount.
I would like to create a variable and set the value in one place, but
use the variable in multiple documents. It looks like I might be
able to do this with a doc variable. But I don't quite understand
how to do it. I see thread with the subject Set Variable in VBA, use
in document, dated 11/29/2005, which talks about it. My problem is I
don't know where to create the variable in the first place. Do I do
it right in my Word document, or do I do it somewhere else? Also,
how do I make it so the variable can be used in multiple documents?

Hi Denise,

A document variable isn't likely to help you in this situation. Document
variables are saved in the file of the document where they're set, and they
aren't (easily) available to other documents.

What would probably serve you better is a separate document containing the
information. You can use one document to hold a bunch of different values.
Insert a bookmark to surround each value that you want to use elsewhere. For
example, let's say that for now the content of the document is just one
line,

Cabana_dues 58.50

Use the Insert > Bookmark dialog to insert a bookmark named Cabana_dues to
enclose just the 58.80 (the first part is there to identify the line for
whoever has to enter new values).

In any other document where you need that information, use the Insert > File
dialog. Choose the document that contains the data, click the Range button,
enter the name of the bookmark (Cabana_dues), and click the down arrow next
to the Insert button and select Insert As Link. That creates a field whose
value is the content of the bookmark. If you change the value inside the
bookmark in the data document, then come back to the field and update it
(select it and press F9), the displayed value will change to the new one.

A variation is that you can use an Excel spreadsheet with named ranges to
hold the values instead of a Word document with bookmarks. The rest of the
procedure is the same. For small amounts of data, though, there's little
practical difference.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
D

Denise

Thanks Jay. I also noticed that if I do a select all before I do the F9, it
will update all the variables in the document.

I have a follow-up question, though. I want to explain to people what I've
done, but don't want the explanation to print out with the document. Can I
put a paragraph at the top of my document that won't get printed out when the
document is printed?
 
J

Jay Freedman

Denise said:
Thanks Jay. I also noticed that if I do a select all before I do the
F9, it will update all the variables in the document.

I have a follow-up question, though. I want to explain to people
what I've done, but don't want the explanation to print out with the
document. Can I put a paragraph at the top of my document that won't
get printed out when the document is printed?

Try one of the methods Greg Maxey describes at
http://gregmaxey.mvps.org/document_user_instructions.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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