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

Gregory K. Hazzard ghazzard at aelfen.net
Wed Mar 12 07:16:39 CST 2003


Having never done this, I'm guessing, but I'd say you need your comma.
According to what I have read on this, since what you're really using is
the second argument, you need to have the comma in the line, indicating
that this is not the first argument.

Here's the example I got from the MSDN:


   Set MyXL = Getobject( , "Excel.Application")

Good luck.

Greg



-----Original Message-----
From: dba-vb-admin at databaseadvisors.com
[mailto:dba-vb-admin at databaseadvisors.com] On Behalf Of
paul.hartland at fsmail.net
Sent: Tuesday, March 11, 2003 8:22 AM
To: accessd at databaseadvisors.com; dba-vb at databaseadvisors.com
Subject: [dba-VB] Opening Outlook if closed code not working

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


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com







More information about the dba-VB mailing list