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...
JKPieterse
Feb 28, 2023Silver Contributor
I'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
https://learn.microsoft.com/en-us/javascript/api/office/office.ribbon?source=recommendations&view=common-js-preview
Kelvin_George
Feb 28, 2023Copper Contributor
unfortunately there is no such option to hide/unhide , only enable/disable option is there. actually iam looking for to create a login/ logout buttons
- JKPieterseMar 01, 2023Silver 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)