0

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.

Madagaga
  • 869
  • 9
  • 11

2 Answers2

0

First this can be done manually with "Edit Message". http://www.msoutlook.info/question/426

Then the CommandBars.ExecuteMso "... method is useful in cases where there is no object model for a particular command." http://msdn.microsoft.com/en-us/library/ff862419.aspx

You have to know the "Identifier for the control." It is "EditMessage".

Sample code here Inserting text into incoming email Outlook 2013 locked read only

Community
  • 1
  • 1
niton
  • 8,771
  • 21
  • 32
  • 52
0

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.

Madagaga
  • 869
  • 9
  • 11