Hi,
How to check if Outlook is running, using vbscript, I need this for my installation procedure to ask the user to close outlook before installing my application.
Thanks,
Hi,
How to check if Outlook is running, using vbscript, I need this for my installation procedure to ask the user to close outlook before installing my application.
Thanks,
Dim Process, strObject, strProcess
Const strComputer = "."
strProcess = "OUTLOOK.exe"
IsProcessRunning = False
strObject = "winmgmts://" & strComputer
For Each Process in GetObject( strObject ).InstancesOf( "win32_process" )
If UCase( Process.name ) = UCase( strProcess ) Then
MsgBox "Outlook is running"
End If
Next
You could try obtaining the Outlook Application object using the GetObject
function. If the function call succeeds, this means that Outlook is currently running:
On Error Resume Next
Dim Outlook: Set Outlook = GetObject(, "Outlook.Application")
If Err.Number = 0 Then
' Outlook is running
Else
' Outlook is not running
Err.Clear
End If