问题
I'm not sure if this is a bug or by design but I have two different add-ins (different manifest files) that I'm developing but I want them to use the same custom ribbon. Currently, it doesn't seem possible.
Expected:
The user should be able to do the following:
Add the first add-in called "A1" (side-loaded or through store)
The Custom ribbon should appear with the name "Awesome Stuff" which has a group of various command buttons that are specific to addin A1.
The user should return a few weeks later and now wants to use add-in "A2" so insert this add-in (via side-loading or office store).
Office would then recognize that the manifest for A2 contains the same ID/Name for the custom ribbon and add the command buttons for A2 into the same custom ribbon created by A1. They would be side-by-side under different Groups.
Observing:
It appears to me that the second add-in will create another tab with the same name and thus two separate manifest cannot share the same Custom Ribbon.
Screenshots of what I'm seeing
Environment
I'm using the latest Office Insiders of Excel (16.8 build 171111). I tested in Excel Online and same result.
Question
- Is this by design or potentially a bug?
- Is there something wrong or missing from my manifest?
- I'm guessing the standard excel ribbons (main, insert, etc...) do not have this problem?
Why not use a single manifest?
Assuming the above is by design...The second add-in is additive features on top of the first manifest. All the users will be using the features of the first add-in but only certain users will be using the second add-in. If we including it in a single manifest it will confuse users that do not need it so ideally we would like them separate.
回答1:
This isn't possible currently. I recommend visiting the UserVoice and adding this as a suggestion.
That said, there are some interesting concerns this would raise. It would open up the possibility for other add-ins to accidentally (or maliciously) break your add-in's commands/tab by inserting their own commands/tab with the same id
.
A better option, based on the scenario you outlined, would be to support altering the ribbon at run time (there is an existing UserVoice that speaks to this). It sounds like the ability to add or enable/disable commands to the ribbon at run-time would allow you to provide everything in a single add-in.
来源:https://stackoverflow.com/questions/47331908/share-custom-ribbon-with-multiple-add-ins-manifests