S
salad
I'm on A97 and have Outlook 2003 on the computer. I want to use late
binding (not set references) but it appears I'm not having much luck.
The code below works ONLY if Outlook is loaded.
When I start Outlook, it prompts me for a profile. How do you handle
that via Automation? (I don't have any code for that)
Next, if Outlook is not loaded, the CreateObject (in the code below)
bombs out.
If you have any idea on how to start Outlook and handle the profile or
know why I can't get CreateObject to work I'd like to shake your hand
for the help. Here's my code. TIA.
Dim olMailItem As Integer
olMailItem = 0
'Create the Outlook session.
Set objOutlook = GetObject(, "Outlook.Application") 'get reference
'if Outlook is already running.
If Err.Number = 429 Then 'Error 429occurs if Outlook is NOT running.
Err.Clear
'******here is where it bombs out****
Set objOutlook = CreateObject("Outlook.Application")
MsgBox Err.Number
If Err.Number = 429 Then
MsgBox "MS Outlook is not installed on your computer"
Exit Sub
End If
End If
...rest of code processes
binding (not set references) but it appears I'm not having much luck.
The code below works ONLY if Outlook is loaded.
When I start Outlook, it prompts me for a profile. How do you handle
that via Automation? (I don't have any code for that)
Next, if Outlook is not loaded, the CreateObject (in the code below)
bombs out.
If you have any idea on how to start Outlook and handle the profile or
know why I can't get CreateObject to work I'd like to shake your hand
for the help. Here's my code. TIA.
Dim olMailItem As Integer
olMailItem = 0
'Create the Outlook session.
Set objOutlook = GetObject(, "Outlook.Application") 'get reference
'if Outlook is already running.
If Err.Number = 429 Then 'Error 429occurs if Outlook is NOT running.
Err.Clear
'******here is where it bombs out****
Set objOutlook = CreateObject("Outlook.Application")
MsgBox Err.Number
If Err.Number = 429 Then
MsgBox "MS Outlook is not installed on your computer"
Exit Sub
End If
End If
...rest of code processes