Check in code to see if application is open

K

Kristian

Can anyone tell me the easiest way to check if Word is
open on the computer? I have automation code (in Excel
and Access) that creates Word letters and faxes
automatically, but I don't want the code to start another
copy of Word if the application is already open.

Thanks for any tip!
Kristian
 
J

Jezebel

Dim pWordApp as Word.Application

on error resume next
Set pWordApp = GetObject("Word.Application")
on error goto 0

if pWordApp is nothing then
.... Word was not running
 

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