Persistant variables in word 2002

C

Chuck Bowling

I've got a fairly large macro in word 2002 that needs to store document
state variables inside a doc without them being accessible to regular users.
is this possible and if so, where?
 
J

Jezebel

In 2000 you could use DocVariables. Surely this feature is still there?
These function much like CustomDocumentProperties, but the user doesn't know
they are there.
 
T

Thomas Winter

Chuck Bowling said:
I've got a fairly large macro in word 2002 that needs to store document
state variables inside a doc without them being accessible to regular users.
is this possible and if so, where?

If you only need the information while the document is open, you can use
module level variables. They will keep their value in between running of the
macros/procedures in the module.

If you want the information to last between opening and closings of the
document, use document variables or document properties. (Document.Variables
and Document.CustomDocumentProperties in the Word object model). Document
properties can be viewed/changes by the user from the FILE | PROPERTIES
dialog box, so you probably want to use document variables. They are only
accessible by VBA code.

-Tom
 
C

Chuck Bowling

Thomas Winter said:
If you only need the information while the document is open, you can use
module level variables. They will keep their value in between running of the
macros/procedures in the module.

If you want the information to last between opening and closings of the
document, use document variables or document properties. (Document.Variables
and Document.CustomDocumentProperties in the Word object model). Document
properties can be viewed/changes by the user from the FILE | PROPERTIES
dialog box, so you probably want to use document variables. They are only
accessible by VBA code.

Thanks for the help Tom. My need was for persistant variables that stay with
the doc as long as it exists or until they are changed or deleted.
 
C

Chuck Bowling

Thanks Jezebel. If the feature is still there it's exactly what i'm looking
for...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top