2

We are in the process of creating Office 365 Add-ins.

I was wondering, if there was a way to

  1. use same ribbon menu buttons in different hosts (e.g., Word, Excel and PowerPoint, etc.)
  2. If possible, re-use some of the parts in other hosts (e.g., using same ribbon menu buttons in Word and Excel and using only one button out of various in PowerPoint)

Is this possible, right now?

1 Answer 1

1

Yes. That can be done. Within the VersionOverides section of the add-in manifest, each host (Document, Worksheet, Presentation) has its own Host section where you specify the ribbon/menu buttons. You can point to the same URLs and the same Resources (strings) within each Host section, so you can reuse button images/labels, etc. in multiple hosts. If there are buttons you don't need in PowerPoint, you leave those out of the Host section for Presentation.

UPDATE: The manifest is an XML file, so re-using markup basically means that once you have the markup you want in one Host section, you copy-and-paste the parts you want to reuse into other Host sections.

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks for the response. I meant to write the xml once and then re-use it under each host, if possible. Is there a way for that?
If you want a different set of ribbon/menu buttons for different hosts, then you cannot have identical XML within the different Host sections.
Yes. I can understand that. But, I was asking same ribbon buttons for different hosts. What about that? Do I need to repeat that part of the xml for each host? or can I re-use part of that xml?
You repeat it for each host.
Well, it may be sad, but it's a weakness of XML, not the Office Add-in model. It is difficult to encapsulate/refactor with XML other than by just copy-and-paste. You can define complex types, but that does not help in this situation where you need to repeat specific values for specific tags and attributes.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.