Can anybody help me, please? I am trying to figure out how to access the controls in Ribbon UI.
I create a custom tab and add some controls to it, like this:
<?xml version="1.0" encoding="utf-8" ?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnLoad">
<tab id="myTab" label="My Tab">
<group id="group1" label="IO">
<button id="Action" size="large" onAction="OnAction" />
<comboBox id="selector" getItemCount="GetItemCount" getItemLabel="GetItemLabel" onChange="OnChange" maxLength="50" getText="GetText" />
I create the necessary callback functions OnAction, GetItemCount, etc. Now, when I press the button "Action" I would like to be able to access the combo box "selector" and do something based on the current value I find there. However,
I am at loss how to get it. I can store the string RibbonID I get in GetCustomUI() and IRibbonUI I get in OnLoad(), but I do not know how to get a reference to the Ribbon itself or to its Controls collection.
I am able to circumvent the problem by keeping the track of the combo box state in the OnChange function, however it seems quite inelegant.
I would be thankful for any hint.