View Single Post
  #4  
Old May 13th 08, 09:17 AM posted to microsoft.public.access,microsoft.public.outlook,microsoft.public.outlook.program_vba
Stefan Hoffmann
external usenet poster
 
Posts: 2
Default Late binding code

hi Norman,

Norman Yuan wrote:
On Error Resume Next
Set OutlookApp = GetObject(,"Outlook.Application")
If Err.Number0 Then
Err.Clear
Set OutlookApp=CreateObject("Outlook.Application")
If Err.Number0 Then
MsgBox "Cannot get Outlook"
Exit Sub
End If
End If

Due to the nature of Outlook, it is a single instance application, you
don't need the error trapping. The CreateObject will return the existing
instance or start a new one.


mfG
-- stefan --
Ads
 

Mortgage Calculator - Car Credit - Western Union - Personal Loans - Mortgage