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?
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?