View Single Post
 
Old 04-23-2014, 03:35 PM
chrismad chrismad is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Apr 2014
Posts: 5
chrismad is on a distinguished road
Default Storing of variables in add-in

+++ EDIT: decided to provide additional detail in hopes of a response +++

I have an add-in that needs to persistently store a few variables between Word "sessions". I would much prefer to do this in one totally encapsulated .dotm; meaning storing of the variables within the add-in file itself. As far as I can figure, my options are to either use document properties or document variables. Since properties can easily be stripped, I decided to use document variables. Everything worked just fine as long as I tested with a .docx. However, upon conversion to .dotm and storing in the Word startup folder, I ran into the problem that the .dotm technically does not get opened as a global template and therefore the document variables don't seem to be available via "ActiveDocument.Variables(...)" when executing some add-in code via the AutoExec macro.

So, here are my questions:

(a) Am I on the right track w/ the use of document variables or would you suggest a different solution?
(b) What's the way to read/write from/to the variables in the .dotm.
(c) It seems to me that the document properties would have the same issue if I would have gone that route.

Thanks for your help.

Last edited by chrismad; 04-23-2014 at 08:45 PM. Reason: More detail
Reply With Quote