Fix to start Outlook 2002 CreateItem Error

  • Thread starter Thread starter David L.
  • Start date Start date
D

David L.

Following is the fix for an error to create email through
Outlook 2002, if Outlook is not originally started.

Dim olApp as Outlook.Application
Dim olMsg as Outlook.MailItem

Set olApp = New Outlook.Application
Set olMsg = olApp.CreateItemFromTemplate("blankemail.msg")
'Set olMsg = olApp.CreateItem(0) <- Not work in OL2002 if
not already started

I do not guarantee it will solve CreateItem problem for
other people with similar Outlook2002 create email error,
I suspect local installation variances (e.g. patch level,
initial config) contributed to these errors.

The original code still work on machines that had
Outlook2000 installed, and will start Outlook in the
background if necessary.

David
10 Oct 2003
 
You can also log into the Outlook session and that should work for
CreateItem. NameSpace.Logon.
 
Back
Top