saving varibles

C

Carl

Hi all
How do you save teh value of a varible to be used in other
template?
I have a sub in template (Template1) with the varible
(MyVar) that closes Template1 and opens another template
(Template2) that needs MyVar.
I am using Word97 and WordXP.
 
J

Jay Freedman

Carl said:
Hi all
How do you save teh value of a varible to be used in other
template?
I have a sub in template (Template1) with the varible
(MyVar) that closes Template1 and opens another template
(Template2) that needs MyVar.
I am using Word97 and WordXP.

When you close Template1, any variable value in the template's memory
will disappear. You need to save it somewhere else -- as a document
variable (a member of the ActiveDocument.Variables collection), or as
a registry value or a value in an "ini" file (using the
PrivateProfileString function). When Template2 loads, its code can
then read the value from wherever you stashed it.
 

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