Conditional Closing of open Word Doc

  • Thread starter jer99 via AccessMonster.com
  • Start date
J

jer99 via AccessMonster.com

I have the following code:
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDir & m_strTemp)
(populate bookmarks)
(print)
(save)
m_objDoc.Close
m_objWord.Quit

Set m_objDoc = Nothing
Set m_objWord = Nothing

It works great. But if there is an error, it goes to the error handler and
bypasses the close/quit logic.
Is there a way to test to see if it is open and if so, THEN close it?
 
G

Guest

Type Open Word Doc into the search engine of this thread and you should find
several responses that detail how to do this.
 

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