Re: How to tell if word is already running
- From: JWS315 <JWS315@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 12:20:04 -0700
Dirk - Thanks!
One additional question, If I find it is running can I issue a quit command
(oWord.Quit) to close the running instance before continuing my code? Will
this allow the user to either save the current document or will it just close
Word without offering a save as dialog?
TFH! - Jerry
"Dirk Goldgar" wrote:
> "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)
>
>
>
.
- Follow-Ups:
- Re: How to tell if word is already running
- From: Dirk Goldgar
- Re: How to tell if word is already running
- References:
- How to tell if word is already running
- From: JWS315
- Re: How to tell if word is already running
- From: Dirk Goldgar
- How to tell if word is already running
- Prev by Date: Re: How to tell if word is already running
- Next by Date: Re: Close files
- Previous by thread: Re: How to tell if word is already running
- Next by thread: Re: How to tell if word is already running
- Index(es):
Relevant Pages
|