PDA

Click to See Complete Forum and Search --> : [Resolved]Checking if outlook is open from VB


adhavanv
Aug 19th, 2005, 11:43 AM
How to check if outlook is open or not from a Visual Basic application.

RobDog888
Aug 19th, 2005, 01:28 PM
Use the GetObject function.
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