Malcolm Greene wrote on 2011-03-08:
> A question for you MS Word mavens:
>
> Within a Word macro/VBA code block I need to determine whether an
> external application is running so I can start the application if it
> is not already running.
>
> Is there a way to accomplish this in Word or do I need to use a
> win32 API call (I'm thinking of checking for the presence of a
> specific mutex value)? Or might there be simpler ways to do this like
> having my external application lock a specific file that Word can try
> to write to to determine whether the other application is running?
>
> By Word I mean Word 2003 or higher.
>
> Any ideas appreciated.
>
> Thank you,
> Malcolm
>
Malcolm,
If you want the other application to activate:
'Activate window
dim sh
set sh = createobject("wscript.shell")
if not sh.appactivate("No application") then
wscript.echo "Not found"
end if
set sh = nothing
Experts-Exchange shows a way to do a search using the TaskList.EXE and
processing its output.
VBScript Script to Enumerate all Window Handles with an Idential Window
Title : Microsoft, VBScript http://goo.gl/MSy5v
Tracy Pearson
PowerChurch Software
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/001501cbddd9$1fe98330$5fbc8990$@com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.