Function IsOutlookRunning()
strComputer = "."
strQuery = "Select * from Win32_Process " & _
"Where Name = 'OUTLOOK.EXE'"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery(strQuery)
For Each objProcess In colProcesses
=> colProperties = objProcess.GetOwner(strNameOfUser,strUserDomain)
If UCase(objProcess.Name) = "OUTLOOK.EXE" Then
=> If objSysInfo.Username = strNameOfUser Then IsOutlookRunning = True
=> Else
=> IsOutlookRunning = False
=> End if
Else
IsOutlookRunning = False
End If
Next
End Function
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (1)
Commented: