[dba-VB] Opening Outlook if closed code not working

paul.hartland at fsmail.net paul.hartland at fsmail.net
Tue Mar 11 08:22:14 CST 2003


To all,

Can anyone see why the following code (VB6) would open Outlook even if it is already open, I want a module that when I run my application, it checks to see if Outlook is open if not open it......

Function OpenOutlook()
    Dim objOut As Object
    On Error Resume Next
    
    Set objOut = GetObject("Outlook.Application")
    
    If (Err <> 0) Then
        Dim strOpenOutlook
        strOpenOutlook = Shell("D:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\OUTLOOK.EXE", vbMinimizedNoFocus)
    End If
End Function

Thanks in advance.

Paul

__________________________________________________________________________
Freeserve AnyTime - Go online whenever you want for just £6.99 a month for
your first 3 months, that's HALF PRICE! And then it's just £14.99 a month
after that.

For more information visit http://www.freeserve.com/time/ or call free on 
0800 970 8890





More information about the dba-VB mailing list