Reputation: 245
I am working on an add-in to Office365/Office2016 which helps archiving office document into our own repository (content server). Users can initiate content management related operation using add-in command which are shown as ribbon button onto the office ribbon. This operation includes importing document into repository, exporting from repository and showing up into office application etc.
Problem: While the add-in command helps initiating operation into the add-in perfectly fine, we do not see these add-in buttons can be dynamically enabled\disabled on the ribbon. These buttons are static and can only be added and removed using only manifest file which is not a feasible solution. This was the case with office thick client COM based add-in. While this functionality is missing in officeJS.
Upvotes: 2
Views: 1100
Reputation: 43
Enabling and disabling custom add-in commands (buttons and menu items) dynamically are currently supported and it is in preview mode as of today. please find the Microsoft link.
Developer docs: https://learn.microsoft.com/en-us/office/dev/add-ins/design/disable-add-in-commands
Upvotes: 0
Reputation: 6912
All ribbon controls are described in the manifest.xml file and currently do not have any dynamic control over them. You cannot disable/enable the items.
If you want to see this feature in upcoming Office.js releases, you may post your own business case request at officespdev.uservoice.com or up-vote similar request: Support dynamic content in Add-in commands ribbon dropdown menu
Upvotes: 3