Receive Error (404) Automation Error when creating new mailitem from MS Access 
Author Message
 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



Sat, 13 Aug 2005 07:41:44 GMT  
 Receive Error (404) Automation Error when creating new mailitem from MS Access
Before you set the MailItem, try logging in:

Set oNamespace = objOutlook.GetNamespace("MAPI")

oNamespace.Logon <an outlook profile>


Quote:
> 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



Sat, 13 Aug 2005 21:52:46 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. new window appear showing 404 error when I close a web report

2. Error -2147417848 Automation Error received

3. webbrowser error 404

4. Error with WebBrowser (HTTP 404)

5. ITS NOT A VIRUS, ITS A 404 ERROR, FILE NOT FOUND

6. Need Help => error 404 using MDI

7. Checking for error http 404 on web page loading with webbrowser object

8. ASP 404 Error Tracker

9. Need Help => error 404 using MDI

10. How to trap HTTP 404 errors.

11. 404 server error, redirect

12. HTTP 404 error

 

 
Powered by phpBB® Forum Software