Word Save Document Macro

Y

Yavuz Bogazci

Hi,

i have create a Word Makro with has Events for SaveAs,
SaveAll, DocumentClose. I don't want that the user saves
the Document.

That works fine. But my question is the following:

How can i call a Makro with Events like onClose, onSave
from another Word Document? That means i have Doc1.doc and
MacroDoc.doc. Now i want to run Doc1.doc and on Startup or
CommandLine i want to call the Macros of MacroDoc.doc.

Or otherwise:

How can i add a Macro to a Word Document wich is stored in
a .bas File via CommandLine????


Thank you
Yavuz Bogazci
 
C

Charles Kenyon

You can make macros generally available by putting them in a global
template. This is stored in the user's Word Startup folder. Check out the
vba FAQ on the MVP FAQ page for instructions on creating pseudo-auto macros
in a global template.

For a macro in a global template to run upon starting Word it needs to be
called AutoExec.
--

Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
W

Word Heretic

G'day "Yavuz Bogazci" <[email protected]>,

store macrodoc as a template in the startup drawer and make a ref to
it from Doc1.doc or its template.

Yavuz Bogazci said:
Hi,

i have create a Word Makro with has Events for SaveAs,
SaveAll, DocumentClose. I don't want that the user saves
the Document.

That works fine. But my question is the following:

How can i call a Makro with Events like onClose, onSave
from another Word Document? That means i have Doc1.doc and
MacroDoc.doc. Now i want to run Doc1.doc and on Startup or
CommandLine i want to call the Macros of MacroDoc.doc.

Or otherwise:

How can i add a Macro to a Word Document wich is stored in
a .bas File via CommandLine????


Thank you
Yavuz Bogazci

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

Replies offlist may require payment.
 

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