Page 1 of 1

How to determine if Word is open?

Posted: 17 Oct 2018, 13:54
by Rafio
I have a script that imports images from Powerpoint or Word, depending on the hotkey.
But if I enter the key to import from PPT and Word is not open, ComObjActive triggers an error.

Is it possible do avoid the display of this error?

Re: How to determine if Word is open?  Topic is solved

Posted: 17 Oct 2018, 13:56
by jeeswg
- Two ideas are:
- if WinExist("ahk_class OpusApp") ;MS Word
- A try/catch block:
Try - Syntax & Usage | AutoHotkey
https://autohotkey.com/docs/commands/Try.htm

Re: How to determine if Word is open?

Posted: 20 Oct 2018, 08:03
by Rafio
jeeswg wrote:
17 Oct 2018, 13:56
- if WinExist("ahk_class OpusApp") ;MS Word
Thank you, jeeswg, that did the trick!