I'm using the following code to manipulate some word docs from Access:
Dim appWord as Word.Application
If appWord Is Nothing Then Set appWord=CreateObject("Word.Application")
appWord.Visible = True
appWord.Documents.Open FileName:="xx.doc"
' set doc properties here
This works fine, except if the user closes Word from within Word. In that
case, when back in Access, appWord is *not* nothing, so the object is not
created, and the visible statement fails. I have trapped this error and
create the object in the error handler, but am wondering if there is a more
robust way to test if the application has been closed.
Thanks.

Signature
Ted
Jay Freedman - 07 Oct 2006 18:44 GMT
Have a look at the technique in
http://www.word.mvps.org/FAQs/InterDev/ControlWordFromXL.htm. The same
thing should work from Access.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
>I'm using the following code to manipulate some word docs from Access:
>Dim appWord as Word.Application
[quoted text clipped - 9 lines]
>robust way to test if the application has been closed.
>Thanks.
TedMi - 09 Oct 2006 15:06 GMT
Thanks Jay, that works

Signature
Ted