Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot send Email when Outlook closed
Message
From
16/01/2003 21:52:54
 
 
To
16/01/2003 21:26:27
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00742714
Message ID:
00742720
Views:
20
Hi Mark,

Step through it and see which file is not found... this would help a bit in tracing this error... I kind of had this problem too, but before I can tell you what was wrong here we should insure the file issue is the same.

Ric

>Hi,
>
>I'm using the code below to send email automatically from my app.
>When outlook is open, it works great.
>When outlook is closed it fails.
>I get the following error:
>
>OLE Dispatch exceptioncode 4096 from Microsoft Outlook:
>The system cannot find the file specified.
>
>Do I need to start Outlook from VFP or is there something else I can do?
>If I do need to start Outlook from VFP, how do I do that?
>
>Any thought would be appreciated.
>
>Thnks,
>Mark
> SendTo="XXX@XXX.COM"
> SendFile="c:\test.txt"
>
> myOlApp=CREATEOBJECT("Outlook.Application")
> myItem =myOlApp.CreateItem(0) &&Creates a message
> myNameSpace=myOlApp.GetNameSpace("MAPI")
> myNameSpace.LogOn("XXX","XXX")
> myItem.To=SendTo &&Recipient
> myItem.Subject="CLAIM: " + vClaimsH.claim_no &&Subject
> myItem.Body=""
> *= Send Message Label and File to Outlook Outbox ========================
> myAttachments = myItem.Attachments &&Creates a collection of attachments
> FileAtt='myAttachments.Add("'+SendFile+'")' &&Adds an attachment to the collection
> &FileAtt
> myItem.Send
> myNameSpace.LogOff
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform