Search code examples
outlook-addin

Outlook AddIn open in edit mode


How to open a received MailItem in EditMode (compose). Not reply but like a resend to edit content then execute a custom action. The custom action is ok, but i'm not able to open in edit mode.

Here is a piece of code :

MailItem item = inspector.CurrentItem;
item.Copy();
item.Display(false);

I've tried to use item.Forward() instead of item.Copy() it works, but i dont have original sender ... etc .

Thanks for help.


Solution

  • Finally, i found a simple way to do what i wanted.

    Just by forwarding the mail, then edit sender, and recipients.

    Outlook.MailItem item = inspector.CurrentItem;
    Outlook.MailItem newItem = item.Forward();
    newItem.Sender = item.Sender;
    newItem.Subject = item.Subject;
    [...]
    item.Close(Outlook.OlInspectorClose.olDiscard);
    newItem.Display();
    

    And it works.