View Single Post
 
Old 11-22-2020, 11:24 PM
Charles Kenyon Charles Kenyon is offline Windows 10 Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,537
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Document variables persist if the document in which they are created is saved.
Code:
ActiveDocument.Save
'(or)
ThisDocument.Save
They become a part of the document, although not displayed in the document. They are strings and if set to a null value are deleted. (If changed or deleted, the document must again be saved for that change to persist.)

Document variables are available as long as the document/template is open, attached or loaded as an Add-In. I do not know that they can be accessed on a closed document/template. They are available in any module and for that matter any project. For a project other than the one holding the variables, I would probably use a public function in the template holding the variables. It would be a lot easier for me to write.
Reply With Quote