Mark L was telling us:
Mark L nous racontait que :
> If I have VBA code in a Word document which is using a module, some
> forms and ThisDocument (ie Document_Open and Document_Close), where
[quoted text clipped - 4 lines]
> can give me. --
> Mark L
You cannot have public declarations in a class module (ThisDocument is a
"special" class module).
Create a module that you could call "PubVariables" and use it to declare
those public variables.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Jonathan West - 24 Feb 2005 15:22 GMT
> Mark L was telling us:
> Mark L nous racontait que :
[quoted text clipped - 10 lines]
> You cannot have public declarations in a class module (ThisDocument is a
> "special" class module).
That's not strictly true. You can have public declarations in a class
module, but they don't act as global variables, they act as public
read-write properties of the class.
> Create a module that you could call "PubVariables" and use it to declare
> those public variables.
That is the way to do it. Variables declared as Public and defined before
the first Sub or Function in a module will be available to all modules,
classes and UserForms within the same project.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup