13

We are trying to put third-party add-in controls onto a custom ribbon via our add-in.

1) Customization via modifying the PowerPoint.officeUI is working:

<mso:customUI
    xmlns:x1="ThirdPartyAddin"
    xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
    <mso:ribbon>
        <mso:qat/>
        <mso:tabs>
            <mso:tab id="my_new_tab" label="my_new_tab">
                <mso:group id="Test" label="New Group" autoScale="true">
                    <mso:gallery idQ="x1:TheirFunction1" visible="true"/>
                </mso:group>
            </mso:tab>
        </mso:tabs>
    </mso:ribbon>
</mso:customUI>

We've extracted this xml by using File > Options > Ribbon Customization and inspecting the resulting PowerPoint.OfficeUI file.

2) Putting the below into our add-in code to be returned from IRibbonExtensibility.GetCustomUI also referred to as RibbonXML:

<mso:customUI
    xmlns:x1="ThirdPartyAddin"
    xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
    <mso:ribbon>
        <mso:tabs>
            <mso:tab id="my_new_tab" label="my_new_tab">
                <mso:group id="Test" label="New Group" autoScale="true">
                    <mso:gallery idQ="x1:TheirFunction1" visible="true"/>
                </mso:group>
            </mso:tab>
        </mso:tabs>
    </mso:ribbon>
</mso:customUI>

Notes:

  • With the mso:gallery In PowerPoint there are no UI XML error reports.
  • We removed because the Quick Access Toolbar can't be modified that way.
  • Instead of the gallery shown here I also tried with a button which is listed as mso:control in PowerPoint.officeUI but which I had to change into mso:button for GetCustomUI otherwise PowerPoint would complain "0x80004005 Custom Controls cannot be specified as < control >. Control type is required about ID x1:theirFunction2

Problem

The item does appear but it's not working. it has the little arrow for gallery but has no icon.

Observations

  • Ironically one can right click it and add it to the Quick Access Toolbar, where it's working again.
  • unloading the third party add-in while having the GetCustomUI add-in loaded will result in a minor update of the control

    see screenshot

Related Documentation

  • From Cindy's comment I investigated "control" more appearantly there is a quite similar question, unfortunately the answer is unconfirmed: Can controls be clone
  • Also this is documentation on the "control" MSDN
Cilvic
  • 3,417
  • 2
  • 33
  • 57
  • One obvious difference is that in the first it's ms:control but in the second mso:gallery. If you substitute control for gallery in the second does it then work? – Cindy Meister Apr 13 '16 at 13:50
  • Thanks Cindy Good pickup. PowerPoint actually complains about "control" so i changed it to gallery. I'll edit the question to provide more detail. – Cilvic Apr 13 '16 at 16:45
  • Double-checking what you're saying: In the first instance you're not using a RibbonXML, but doing what the user does through File/Options/Customize Ribbon? But: does this third-party actually define idQ with the same namespace in their RIbbonXML? If the third-party has not exposed its controls specifically, you can't use them in your RibbonXML. The user can as that's part of "the contract" the user has with controls on "his" Ribbon. But that doesn't expose them to others. – Cindy Meister Apr 13 '16 at 19:11
  • Thanks for taking the time to dig through this Cindy. I'm trying to clarify by editing the question. You are correct the first case is "user-driven" first we started "Customizing" the Ribbon and then extracting the relevant parts from the PowerPoint.OfficeUI file where those customizations are stored. I do not know if the add-in defines the same idQ with the same namespace in their RibbonXML. I was assuming their is no difference if the idQ shows up. Are you implying that there is a difference from the add-ins XML in defining the idQ either for "user-customization only" or for "other add-ins"? – Cilvic Apr 13 '16 at 21:39
  • I just saw another question on the topic on MSDN, that you moved in the forum :-) small world ... – Cilvic Apr 13 '16 at 22:05
  • Yes, there's definitley a difference between the user Ribbon customization and a third-party (you) incorporating functionality provided by an add-in. By design, anything provided by an addin is "private" and is only exposed to the user. It needs to be explicitly exposed by the add-in for another party to use it. And even then, it can only be "shared" (i.e. you can put your controls in the same group or on the same tab), not "leveraged" (code executed). – Cindy Meister Apr 14 '16 at 05:14

0 Answers0