Cloning an Office JS add-in control from the ribbon to a document-level customUI definition

Jamie Garroch MVP 1 Reputation point MVP
2022-05-06T12:09:56.147+00:00

I have a simple Office.JS add-in that includes a button in the home tab to activate the add-in's taskpane.

Using the Office ribbon customisation UI (right click anywhere on the ribbon and select "Customize the Ribbon..." I can clone that control to a custom group elsewhere in the ribbon. When I export the customisation and examine it I can see the control is added as follows:

<mso:control idQ="x1:Btn_6a082d12-101a-4a65-961f-994ece843132_MyButton_TabHome" visible="true"/>  

And the following namespace is created at the top of the customisation file:

xmlns:x1="6a082d12-101a-4a65-961f-994ece843132_EXCatalog"  

Where: (ref)

  1. 6a082d12-101a-4a65-961f-994ece843132 is the GUID in the manifest.xml file
  2. EXCatalog is the store type and refers to the fact that this add-in was deployed via the M365 Admin Centre

I now add both the namespace and control snippet to the customUI of a document, modifying the control snippet to specify the control type (type "control" is not permitted for non-MSO/custom controls) and removing the explicit mso namespace (because it's defined at the top of my custom UI file) as follows:

<button idQ="x1:Btn_6a082d12-101a-4a65-961f-994ece843132_MyButton_TabHome" visible="true"/>  

The button doesn't render as expected when opening that document. There is a space assigned for it but no button image or label or onAction callback. There are three variation attempts in this screen capture:

Image

Does this mean cloning of web-based add-in controls in the customUI of a document isn't supported by the Agave framework?

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
883 questions
{count} votes