>>>I am using Outlook from my VFP6 program to send an email. I default the recipient, etc. and then show the Outlook form for the user to make changes and send the email. When the user sends, I want to retrieve the message text and use it in my VFP program. How can I get the text of the message that the user sent?
>>
>>If oMessage is your object, the text should be in oMessage.body; if it's a HTML message, then oMessage.HTMLBody. However, I have used this on old messages only (working on archiving into .dbf, Outlook seems to have no track of related messages). These properties exist for a outlook.MailItem object.
>
>This works for passing a message TO the object, but it doesn't seem to work for retrieving the message FROM the object once a user has changed the text of the message. Any other suggestions appreciated.
It's probably already moved to Sent folder, so you'd need to get it from there. It should be something like
oFolder=oOutlook.session.folders("Sent")
oLastMessage=oFolder.messages(oFolder.oFolder.messages.count)
but I'm not sure how does Outlook store the most recent message into the collection - as first, last or what. I also don't know if folder name is accepted as a parameter in the first line, or it needs a constant, which I actually don't have, but can be obtained from Outlook's object browser.