none
Update Ribbon dynamically on context RRS feed

  • Question

  • Hi,

    I am trying to have some togglebuttons in my Powerpoint Ribbon that show the setting for the current object that is selected. E.g., I select a textbox and the togglebutton "wordwrap" shows you if the textbox has wordwrap enabled or not.

    To add such a togglebutton with two state (on/off) is not an issue. But I am having problems linking the button state to the object setting.

    My idea is to use the "Windowselectionchange"-event to get the respective setting. But how do I access the buttons of the Ribbon while Powerpoint is running?

    Help highly appreciated

    Christian

    Monday, May 28, 2012 11:57 AM

Answers

  • The WindowSelectionChange should do what you need, I have done something similar using Word VSTO before.

    Can you get to the ribbon using the following code?

                ThisRibbonCollection collection = Globals.Ribbons;
                collection.GetRibbon("RibbonName");

    Monday, May 28, 2012 12:10 PM
  • if you are using ribbon xml, call ribbon.InvalidateControl(id of your control) and provide in xml callbacks for its state (getVisible, getEnabled, etc.)

    Monday, May 28, 2012 12:19 PM

All replies

  • The WindowSelectionChange should do what you need, I have done something similar using Word VSTO before.

    Can you get to the ribbon using the following code?

                ThisRibbonCollection collection = Globals.Ribbons;
                collection.GetRibbon("RibbonName");

    Monday, May 28, 2012 12:10 PM
  • if you are using ribbon xml, call ribbon.InvalidateControl(id of your control) and provide in xml callbacks for its state (getVisible, getEnabled, etc.)

    Monday, May 28, 2012 12:19 PM