Richard Hamm's code helped - I think the problem is creating the body as text, and then trying to attach a rich text object to it (??). Anyway, when I changed the code to:
*Create the Notes object
SESSION=CREATEOBJECT("NOTES.NOTESSESSION")
m.mailfile=SESSION.GetEnvironmentString("MailFile",.T.)
m.MailServer=SESSION.GetEnvironmentString("MailServer",.T.)
DB=SESSION.GetDatabase(M.MailServer,m.mailfile)
DOC=DB.CreateDocument()
DOC.FORM="Memo"
DOC.FROM=SESSION.UserName
DOC.Subject="Subject"
rtitem = Doc.CreateRichTextItem("body")
rtitem.AppendText(l_stdtext)
rtitem.EmbedObject(1454, "", l_attachment)
DOC.SEND(.F.,recipients)
DOC.SAVE(.T.,.T.)
it worked well! I am going to try using the COM object approach instead of OLE to see how it goes....
>I am also using VFP8 SP1. I am at least getting the same error as you. I only get the C5 when I try to use the debugger. I'll let you know if I figure something out.
>
>>I am using VFP 8 SP1, Lotus Notes v5.0.2b and eReports to create the PDF.
>>
>>The error is "OLE error code 0 x 80010105. The server threw an exception" and it occurs on the DOC.Embed line (according to the VFP debugger). If I comment out that line, everything goes as planned - the pdf is created, the Lotus Notes doc is created and sent.
Phil Thomas
http://phillipdthomas.comNever let your energy or enthusiasm be dampened by the discouragements that must inevitably come.....