elle0612 was telling us:
elle0612 nous racontait que :
> Hi
>
[quoted text clipped - 14 lines]
> If I am wrong on all counts, just a simple definition of what
> 'ThisDocument' is would suffice.
ThisDocument is a class module that refers to the code container,
So, for example, let's say you have code in a template (*.dot) that
manipulates Document Variables.
Now you create a document based on that template.
Suppose you have this code :
ActiveDocument.Variable("Test").Value = "MyName"
ThisDocument.Variable("Test").Value = "MyName"
The first line will update (or create it if it does not exist) a variable
called Test in the currently active document (or the document created from
the template that contains the code).
The second line will update the variable in the template itself, not the
document.
So, when you use ThisDocument in the code, you are referring to the code
container, usually the template used to create the currently active
document.
Since a template is not really "opened" when you create a document, you
cannot open/close it in the normal sense. It is available because it is
attached to a document and is loaded. If you modify it (as in my example
above) you will have to save the changes unless you want them discarded.
You could actually open it is well, but this is very rarely necessary.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org