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