macros in documents

J

J Lunis

This may not be the appropriate ng for this. If not, jsut direct me to
the one I need.
Using XP and Word 2003. I have created a document with a number of
macros that run ever time I tab to a new field. This all seems to work
as I want it except for two problems.
1) On startup, I am prompted to enable or disable macros. How do I get
Word to automatically run macros in this document?
2) At the end of the document I have a line that should 'kill' the
document. But when the last macro is finished, I get a 'do you want to
save changes' prompt. How do I get Word to close the document
automatically without saving the changes?
 
M

Michael Bednarek

This may not be the appropriate ng for this. If not, jsut direct me to
the one I need.
Using XP and Word 2003. I have created a document with a number of
macros that run ever time I tab to a new field. This all seems to work
as I want it except for two problems.
1) On startup, I am prompted to enable or disable macros. How do I get
Word to automatically run macros in this document?

Tools/Macro>/Security.../Low (Not recommended; just hit E to enable.)
2) At the end of the document I have a line that should 'kill' the
document. But when the last macro is finished, I get a 'do you want to
save changes' prompt. How do I get Word to close the document
automatically without saving the changes?

Try:
ActiveDocument.Saved = True
ActiveDocument.Close
 
J

J Lunis

Michael said:
Tools/Macro>/Security.../Low (Not recommended; just hit E to enable.)


Try:
ActiveDocument.Saved = True
ActiveDocument.Close
Thanks. I suppose to close without saving, it would be
ActiveDocument.Saved = False?
 
M

Michael Bednarek

Thanks. I suppose to close without saving, it would be
ActiveDocument.Saved = False?

No. The above is exactly what you asked for: closing a document without
saving and without a user prompt.

Have you tried it? Have you read VBA Help on the Saved Property and the
examples on that page?
 
J

J Lunis

Michael said:
No. The above is exactly what you asked for: closing a document without
saving and without a user prompt.

Have you tried it? Have you read VBA Help on the Saved Property and the
examples on that page?
Won't be able to do either til tomorrow (Wed). Thanks for the help.
 

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