Need VBA Code to check if MSOutlook is open

  • Thread starter Thread starter TPJoseph
  • Start date Start date
T

TPJoseph

Can someone please provide an example of VBA Code to check if MSOutlook is
open?

Thanks,

Tom
 
Hi,

Try this

Sub TestOutlook()
On Error Resume Next
Set oOutLook = GetObject(, "Outlook.Application")

If oOutLook Is Nothing Then
MsgBox "Outlook isn't open"
End If

End Sub

Mike
 
Thanks, Mike.

Mike H said:
Hi,

Try this

Sub TestOutlook()
On Error Resume Next
Set oOutLook = GetObject(, "Outlook.Application")

If oOutLook Is Nothing Then
MsgBox "Outlook isn't open"
End If

End Sub

Mike
 
Back
Top