Checks whether Microsoft Outlook is open. Requires Microsoft Office 2007 or newer. Returns true if the Microsoft Outlook application is open and false if it’s not.
Table of Contents
Function
VBAFunction IsOutlookOpen() As Boolean Dim blOpen As Boolean Dim oOutlook As Object On Error Resume Next Set oOutlook = GetObject(, "Outlook.Application") On Error GoTo 0 If oOutlook Is Nothing Then IsOutlookOpen = False Exit Function End If IsOutlookOpen = True End Function
Usage example
VBASub TestIsOutlookOpen() Debug.Print IsOutlookOpen() ' true = open, false = not open End Sub