>How can I drive Outlook 2000 to insert the contents of a text file as the body of an e-mail? I do not want to add it as an attachment???
>
>Below is my Foxpro code that includes it as an attachment, but I want to use it as the body text, so that the recipient does not have to open an attachment.
>
>strProfile = "john_may"
>strPassword = "xxxxx"
>strRecipient = "
123546@dfgsdfg.com"
>strSubject = "Test object mail"
>strBody = "this is the message"
>
>theApp = CreateObject("Outlook.Application")
>theNameSpace = theApp.GetNameSpace("MAPI")
>theNameSpace.Logon(strProfile , strPassword)
>theMailItem = theApp.CreateItem(0)
>
>theMailItem.Recipients.Add(strRecipient)
>theMailItem.Subject = strSubject
>theMailItem.Body = strBody
>theAttachments = theMailItem.Attachments
>lcFile = "c:\ww1040c.txt"
>theAttachments.Add(lcFile)
>
>
>theMailItem.Send
>theNameSpace.Logoff
Hey Matt -
Have you considered doing something like this?
theMailItem.Body=strBody+CHR(13)+CHR(10)+FILETOSTR("c:\ww1040c.txt")
Scott
Scott King
The Support Source Corporation