How to check if outlook is open or not from a Visual Basic application.
Printable View
How to check if outlook is open or not from a Visual Basic application.
Use the GetObject function.
VB Code:
Option Explicit 'Add a reference to ms outlook xx.0 object library Private Sub Command1_Click() On Error Resume Next Dim oApp As Outlook.Application Set oApp = GetObject(, "Outlook.Application") If TypeName(oApp) = "Nothing" Then Set oApp = New Outlook.Application End If On Error GoTo 0 'Blah, blah, blah... End Sub