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

VBA
Function 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

VBA
Sub TestIsOutlookOpen() Debug.Print IsOutlookOpen() ' true = open, false = not open End Sub