Take the 2-minute tour ×
  1. In Outlook addin I have two event handlers registered, for MailItem.Forward and MailItem.Open
  2. When I receive Forward, I am getting an object parameter that references a new MailItem object created for the new message.
  3. When I look at object.HTMLBody (or Body), this references the same object as the original mail item does (before forwarding). This object contains an unmodified value of the original message.
  4. When I receive Open event (regarding the same object that the Forward event previously), the event references the same object as forward, but it already contains a new HTMLBody (and Body) - it includes the forward heading etc. added to the original message.

The problem:

If I try to set a new HTMLBody object in step 3) (in Forward event handler), it has no effect.

After returning from event handler what I get in 4) (in Open event handler), is a transformed original message, before my substitution of HTMLBody.

So, there is something happening between Forward and Open events, that replaces the HTMLBody of the new object, but based on its old value (or value of original message).

What is that that is happening?

How can I replace the HTMLBody of forwarded message, not affecting the body of original message, but before it gets transformed according to the forwarding process?

share|improve this question
I fixed my problem by adding a hidden comment tags into HTML, for example: <!--MyTagBegin:OriginalTextHere-->ModifiedTextHere<!--MyTagEnd--> Then, in open event (only after forward/reply occured before) I parse back the mail bringing the original content in. I don't like this solution, but unless someone helps me with my questions, I have to live with it. –  Pawel P Oct 22 '12 at 13:29

Your Answer



Browse other questions tagged or ask your own question.