Re: How to tell if word is already running



"JWS315" <JWS315@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:76C8352A-32A6-479A-8016-5D03221796B5@xxxxxxxxxxxxx
> How can I tell if an instance of Word is already running from Access
> so that I can issue a message to the user to close Word before they
> run my report?

One way is described at this link:

http://www.mvps.org/access/api/api0007.htm
API: Find out if an application is currently running

Another way would be to try to get a reference to the Word application
object, and see if you succeed:

Dim oWord As Object

On Error Resume Next
Set oWord = GetObject(, "Word.Application")
If Err.Number = 0 Then
Set oWord = Nothing
MsgBox "Word is running; please close it."
End If


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.



Relevant Pages

  • Re: %userprofile% - Syntax
    ... Dim oWord as Object ... Set oWord = CreateObject ... Graham Mandeno [Access MVP] ...
    (microsoft.public.access.formscoding)
  • Re: How to tell if word is already running
    ... Jerry ... >> command to close the running instance before continuing ... > Dim oWord As Object ... > Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.modulesdaovba)