views:

332

answers:

1

How might it be possible to activate one of PowerPoint's ribbon buttons from C# ?

We want to be able to run some code in the context that is set up by pressing one of the ribbon buttons.

Just running our code via the interop doesn't work.

I want to be able to do something like this:

Ribbon.GetControlByName(controlName).DoClick()

Does anyone know if something like this might be possible, or know that it's not possible ?

Any hints would be greatly appreciated.

A: 

Going old school on you, but this is one of the best ways (still) to do this, assuming there is a Ribbon<->CommandBar coorelation.

Otaku
Yes ! something like this does work. The answer lies with the routine CommandBars.ExecuteMso(idMso), http://msdn.microsoft.com/en-us/library/aa434602.aspx
Richard Collins