doc.Close stops Exit ?? 
Author Message
 doc.Close stops Exit ??

Hi All

In a Word VBA application I use DocumentBeforeClose event.

This is fired also when I simply do File Exit.

In some special cases I do an explicit doc.Close in the
DocumentBeforeClose procedure. Be sure: no other way then explicitly
doing it here: I have to Delete this DOC-file afterwards (using Kill).

Problem:
        When I use File-->Exit the DocumentBeforeClose is fired. When I do a
doc.Close there it indeed closes the current document and then does
not Exit anymore. I have to Exit again, before Word stops.

What do I do wrong, or how can I continue the quiting. (Not
application.quit, that does not fire a lot of events..)

Best regards,

Hans Troost



Tue, 02 Aug 2005 00:17:31 GMT  
 doc.Close stops Exit ??

Quote:
>Problem:
>    When I use File-->Exit the DocumentBeforeClose is fired. When I do a
>doc.Close there it indeed closes the current document and then does
>not Exit anymore. I have to Exit again, before Word stops.

>What do I do wrong, or how can I continue the quiting. (Not
>application.quit, that does not fire a lot of events..)

G'day Hans Troost,

After the document close, chuck in a

If Documents.Count=0 then application.quit

Steve Hudson - Word Heretic, Sydney, Australia
I can do tricky stuff with Word or words for you.

http://www.geocities.com/word_heretic/products.html
Spellbooks: 1987 pages of dump left and dropping...
Word MVP FAQs: http://www.mvps.org/word/FAQs/index.html



Sun, 21 Aug 2005 15:28:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Auto close open doc when opening another doc

2. Launch doc, ppt, txt, etc and wait for app to exit

3. Launch doc, ppt, txt, etc and wait for app to exit

4. Stopping Windows from Exiting/Restarting

5. Stopping Win95 from Exiting

6. How to stop VBA controls opening with doc

7. Close Form on Exiting a field?

8. ms access not closing after exit, no subform boolean

9. Closing Multiple Forms on Exit

10. Exiting Outlook doesn't close COM AddIns...

11. Close All Items when exiting Outlook

12. Capture Events (not close/open/exit)

 

 
Powered by phpBB® Forum Software