B
bobdydd
Hi Everybody
Access 2000, Outlook 2000 Windows XP
I am running the code below to open Microsoft Outlook from a Command
Button. It works fine until I tried it on a machine that has Office
installed on something other than the "C" drive.
So can anyone advise me how to open Outlook by using a relative path
rather than the code I am using here.
Thanks
Bob
Private Sub CmdOpen_Click()
On Error GoTo Err_Error_Click
Dim MyAppID, ReturnValue
Dim MyXL As Object
Set MyXL = GetObject(, "Outlook.Application")
MsgBox "OUTLOOK IS ALREADY RUNNING", vbInformation, "Oops!"
Exit_Error_Click:
Exit Sub
Err_Error_Click:
If Err.Number = 429 Then
MyAppID = Shell("C:\Program Files\Microsoft
Office\Office\OUTLOOK.EXE", 1)
Else
MsgBox Err.Description
End If
Resume Exit_Error_Click
End Sub
Access 2000, Outlook 2000 Windows XP
I am running the code below to open Microsoft Outlook from a Command
Button. It works fine until I tried it on a machine that has Office
installed on something other than the "C" drive.
So can anyone advise me how to open Outlook by using a relative path
rather than the code I am using here.
Thanks
Bob
Private Sub CmdOpen_Click()
On Error GoTo Err_Error_Click
Dim MyAppID, ReturnValue
Dim MyXL As Object
Set MyXL = GetObject(, "Outlook.Application")
MsgBox "OUTLOOK IS ALREADY RUNNING", vbInformation, "Oops!"
Exit_Error_Click:
Exit Sub
Err_Error_Click:
If Err.Number = 429 Then
MyAppID = Shell("C:\Program Files\Microsoft
Office\Office\OUTLOOK.EXE", 1)
Else
MsgBox Err.Description
End If
Resume Exit_Error_Click
End Sub