R
Rich007
Hi,
I'm trying to store a document variable in an add-in which lives in Word's
start up directory. I can create the docvariable while the add-in is open
(at design time), but I can't figure out to access it from the add-in's
autoexec macro which runs when Word is started (and the addin loads).
The Variables collection is only an object of Documents, not Templates, so
for example this code will NOT work:
Dim strMyAddinPath As String
Dim oVars As Variables
Dim vVar As Variant
strMyAddinPath = AddIns("MyAddin.dot").Path
Set oVars = Templates(strMyAddinPath & "\MyAddin.dot").Variables '!!!!!!!
For Each vVar In oVars
Debug.Print vVar.Name
Next vVar
Is it possible to access a document variable that is stored in a loaded addin?
Cheers
Rich
I'm trying to store a document variable in an add-in which lives in Word's
start up directory. I can create the docvariable while the add-in is open
(at design time), but I can't figure out to access it from the add-in's
autoexec macro which runs when Word is started (and the addin loads).
The Variables collection is only an object of Documents, not Templates, so
for example this code will NOT work:
Dim strMyAddinPath As String
Dim oVars As Variables
Dim vVar As Variant
strMyAddinPath = AddIns("MyAddin.dot").Path
Set oVars = Templates(strMyAddinPath & "\MyAddin.dot").Variables '!!!!!!!
For Each vVar In oVars
Debug.Print vVar.Name
Next vVar
Is it possible to access a document variable that is stored in a loaded addin?
Cheers
Rich