
Receive Error (404) Automation Error when creating new mailitem from MS Access
All,
I'm trying to create a new mail item from MS Access. To do
this, I create an instance of MS Outlook then a new mail
item. Then I get an error message reading, Run-time
error '-2113732605 (82030003)': Internal application
error." The help screen for this error is
titled, "Automation error (Error 440)" - the help is
useless.
Here is the really really wierd part. If outlook is open,
the code runs fine. If it is closed, I get the error. HELP!
AF
=-=-= Code =-=-=
Public Function TestFunction(ByVal strToAddress)
Dim objOutlook As Outlook.Application
Dim objMailItem As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.Application")
Call objOutlook.GetNamespace("MAPI")
Set objMailItem = objOutlook.CreateItem(olMailItem)
Let objMailItem.To = strToAddress
Let objMailItem.Subject = "Test"
Call objMailItem.Display
End Function