Outlook 2010 execute built-in ribbon button

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

Outlook 2010 execute built-in ribbon button
 
nwein




Posts: 577
Joined: 2011-03-28
I've read https://www.add-in-express.com/forum/read.php?FID=5&TID=2581 and also https://www.add-in-express.com/forum/read.php?FID=5&TID=11909 and in the latter one you mention that it should still be supported in 2010, yet all my calls to the commandbars object it returns null.
I even tried late binding but no success either.
I'm basically trying to show the COM Add-in dialog:
User added an image
Any idea if it's possible?
Posted 30 Sep, 2015 11:50:24 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Nir,

Explorer.Commandbars and Inspector.CommandBars still return an Office.CommandBars object.

private void adxRibbonButton12_OnClick(object sender, IRibbonControl control, bool pressed) {
    Outlook._Explorer activeExplorer = OutlookApp.ActiveExplorer();
    Office._CommandBars commandBars = activeExplorer.CommandBars;
    commandBars.ExecuteMso("ComAddInsDialog");
    Marshal.ReleaseComObject(commandBars);
    Marshal.ReleaseComObject(activeExplorer);
}



Andrei Smolin
Add-in Express Team Leader
Posted 01 Oct, 2015 06:02:51 Top
nwein




Posts: 577
Joined: 2011-03-28
I could swear I've tried this and it didn't work!
But yeah, it works :)
Thanks Andrei
Posted 01 Oct, 2015 17:24:09 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
You are welcome! ))


Andrei Smolin
Add-in Express Team Leader
Posted 02 Oct, 2015 03:07:24 Top