I’m using XML to create a custom Excel Ribbon in which I have a button that contains an image. I would like to be able to change this image when the button is pressed (like a toggle) to show what state it’s in. I have the following XML to describe the button:
<button id="MyButton"
label="MyLabel"
screentip="Some useful info."
onAction="MyAction"
getImage="GetImage"
size="large"/>
Where the MyAction method is defined as:
public void MyAction(Office.IRibbonControl control)
{
// Change button image here...
}
Is there some way I can change the button’s image in the MyAction() method?
Cheers
It looks as though you are correct. The only way I have found to edit the appearance of custom ribbon elements is to use ‘Ribbon (Visual Designer)’ and not XML.
For example, if I want to change an image on a toggle button called
toggleButton1I can do the following:where
GetImageis defined as:Cheers