Ribbon Button - Onclick modify current message

Add-in Express™ Support Service
That's what is more important than anything else

Ribbon Button - Onclick modify current message
 
Didier DULIERE




Posts: 3
Joined: 2007-02-20
Hello,

I try to modify the subject of a new message by click on a RibbonButton I've create

The ribbon Button are in the ribbonID "Microsoft.outlook.mail.compose"

But I don't find the solution to read/update the Subject of the message

I'm in Outlook 2016

Many Thx for the help

Kind regards, Didier
Posted 12 Jan, 2017 11:09:09 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Didier,

A raw sketch:

Outlook.Inspector inspector = OutlookApp.ActiveInspector();
object itemObj = inspector.CurrentIte;
if (item is Outlook._MailItem) {
    Outlook._MailItem mail = item as Outlook._MailItem;
    mail.Subject = "new subject";
    // mail.Save();  // you may need to call this method 
}
Marahal.ReleaseComObject(item); item = null;



Andrei Smolin
Add-in Express Team Leader
Posted 13 Jan, 2017 03:21:34 Top
Didier DULIERE




Posts: 3
Joined: 2007-02-20
Morning Andrei

working !, many thanks for the quick reply and great support !

Have a wonderfull day

Kind regards, didier
Posted 13 Jan, 2017 03:27:06 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 13 Jan, 2017 03:41:34 Top