Dim olApp As Outlook.Application
Dim oNS As Outlook.Namespace
On Error resume next
Set olApp = GetObject(, "Outlook.Application")
If Err.Number = 429 Then
Set olApp = CreateObject("Outlook.Application")
Set oNS = olApp.GetNamespace("MAPI")
oNS.Logon "", "", False, True
End if
|