Forum Discussion
Kelvin_George
Feb 27, 2023Copper Contributor
office addin -Excel
hello everyone!
Is there a way to dynamically change the icon and label text in addin commands in custom tabs in a Ribbon? I've created an Excel command button (with manifest.xml) and want to change the icon and text whenever the user clicks on the button.
3 Replies
- JKPieterseSilver ContributorI'm not sure if you can do that. A trick might be to have multiple buttons with the correct icon and hide/unhide as appropriate. Not sure of that is possible either though. Perhaps this article gives you some pointers?
https://learn.microsoft.com/en-us/javascript/api/office/office.ribbon?source=recommendations&view=common-js-preview- Kelvin_GeorgeCopper Contributorunfortunately there is no such option to hide/unhide , only enable/disable option is there. actually iam looking for to create a login/ logout buttons
- JKPieterseSilver ContributorWell, I wonder because if I read this, it seems you can pass a ribbon specification as a JSON string:
https://learn.microsoft.com/en-us/javascript/api/office/office.ribbon?source=recommendations&view=common-js-preview#office-office-ribbon-requestcreatecontrols-member(1)