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.