I've tried everything I can think of and cannot figure this out. Basically, I'm making an Outlook 2010 Add-In that makes adjustments to incoming HTML formatted emails for the purposes of making them more Accessible to visually-impaired users (visually impaired users in particular.)
Everything works fine, except that when my Add-In runs, it actually attempts to modify the original email no matter what I try, which Exchange connected Outlook doesn't like at all and rejects. What I want to do is display my modified email message with all of the goodies (reply, reply-all, BCC, etc., just like you would normally use Outlook) without modifying the original message...that is, I only want to display my modified message, not modify the stored message or add a new message.
Such as:
if (selObject is Outlook.MailItem)
{
Outlook.MailItem mailItem = (selObject as Outlook.MailItem);
Outlook.MailItem accessible_mail_item = mailItem;
...rest of my code...
accessible_mail_item.Display(false);
}
The problem I have is, "accessible_mail_item" is not a copy of "mailItem"...it's a pointer to it. How can I make a copy/clone of this non-Serializable/Clonable Object? I've tried various "Deep Clone" functions out there, but they all give me the same errors about "not being serializable" or whatever.