Miroslav Jasso
Miroslav Jasso

Reputation: 151

Microsoft.Office.Interop.Outlook temporarily change email body

I need to change email body using Microsoft.Office.Interop.Outlook (C# Outlook Adding). But I need to change it only for presentation, not permanently. It means: When user select another email, click replay/forward, etc. the email body must be returned into original. I don't want change the email body permanently.

I am able to access and edit the body by this property but it is permanent and saved on Exchange server. Is there any other solution of my problem?

Thanks a lot for answers, Miroslav Jasso

Upvotes: 0

Views: 473

Answers (1)

Eric Legault
Eric Legault

Reputation: 5834

It sounds like you want to preseve the original message body of the source item that is replied to in the replied/forwarded message that is sent out. To do so you'd need to store the original MailItem.HTMLBody property value in a custom property within the outgoing message. You can do that by adding a UserProperty to the MailItem.UserProperties collection. However, there is a limit to the size of the property value that can be used and this can be exceeded if an email has a very big message body. You may need to save the original message body in an attachment if this occurs.

Upvotes: 1

Related Questions