Pass document reference into another doc?

E

Ed

I want the Document_Open macro in one doc to open another doc. The second
doc also has a Document_Open macro, and the first doc stays open until the
second doc is finished. Can I pass the object reference from the first doc
to the second so the second can completely close that instance of Word? Or
set a reference while the doc is open with a macro running and cause it to
close?

Ed
 
S

Stephanie

Hi, Ed,

There should be no reason that you can't quit the application from the
second document_open event.

If the documents have performed all actions they need to (including saving
content, if necessary) -- just set the .Saved property for all open documents
to True and then you can use Application.Quit to completely shut that
instance of Word.

Does that answer your question?

(It might be tomorrow before I can check back. I hope that was helpful.)

Best,
Stephanie Krieger
author of Microsoft Office Document Designer (from Microsoft Learning)
email: MODD _ 2003 at msn dot com
blog: arouet.net
 
E

Ed

Thanks for trying, Stephanie, but it seems that the macro in the first doc
isn't finished until all the macros in the second doc are finished, so
shutting down the first doc ends the macro there - and stops the macros in
the second doc, too. Since it will be Monday before I'm back here, I'll
play with it and yell for help if I'm still stuck.

Ed
 

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