To check if Word is running:

  if Succeeded(GetActiveObject(CLASS_WordApplication, nil, Unknown)) then
     ShowMessage('Word is running!');

hope that helps.
Allan.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of John
Sent: Tuesday, 5 August 2003 8:33 a.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Running Word Doc


Hi all,

If I run           w := GetWindowHandle('Delphi 5')       then it shows
nicely the handle for the Delphi application.

When I run   w := GetWindowHandle('Microsoft Word - Test.doc'),    this
after starting Word with the file Test.doc, then it can not find it.

Any ideas why and how to check if this Word document is open, or how to
check if Word is running at all?

Thanks a lot for any help,

John.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to