Link to home
Start Free TrialLog in
Avatar of ChenChen
ChenChenFlag for Afghanistan

asked on

Detect if outlook is running.

Hi,
I want to use vb code to detect if my outlook is running or not. Is there a simple way?
Avatar of TNC0292
TNC0292

you could try something like:
set wmi = getobject("winmgmts:")
sQuery = "select * from win32_process where name='outlook.exe'"
set processes = wmi.execquery(sQuery)
isOutlookRunning = (processes.count > 0)
ASKER CERTIFIED SOLUTION
Avatar of mindless_idiot
mindless_idiot

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ChenChen

ASKER

Thanks mindless idiot. It works fine after I altered "Outlook Express" to "Microsoft Outlook".

TNC0292, I couldn't get yours working, don't know why.
How would I use this code in the On_Click event of another button...without the fields and the command button you talk about in your solution?