How to determine if Word is open? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Rafio
Posts: 41
Joined: 07 Oct 2018, 05:14

How to determine if Word is open?

17 Oct 2018, 13:54

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?
--
Windows 11
AHK 1.1.35.00
Adventure 3.0.4
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

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

17 Oct 2018, 13:56

- 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
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Rafio
Posts: 41
Joined: 07 Oct 2018, 05:14

Re: How to determine if Word is open?

20 Oct 2018, 08:03

jeeswg wrote:
17 Oct 2018, 13:56
- if WinExist("ahk_class OpusApp") ;MS Word
Thank you, jeeswg, that did the trick!
--
Windows 11
AHK 1.1.35.00
Adventure 3.0.4

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww and 129 guests