none
Add-In Ribbon Control Possible? RRS feed

  • Question

  • Word 2010 with Win 7

    I have customized the ribbon through XML and VBA but would like to manipulate two COM Add-Ins that are loaded automatically at startup. They are Adobe Acrobat and Workshare Compare. I only want one button from each and combine them on one tab rather than the 2-tab mess that they generate. We don't want users accessing the other buttons.

    Loading a ribbon customization file through Word's interface overwrites any user QAT customizations so that is not a solution. I need to go behind the scenes.

    Opening the add-ins in notebook shows the XML code (which I guess I can't edit without loading errors :( ) and the .officeUI file has the following reference to the add-ins:

    <mso:customUI xmlns:x3="Workshare.Ribbon.Addin.Connect" xmlns:x2="PDFMaker.OfficeAddin" xmlns:x1="http://schemas.microsoft.com/office/2009/07/customui/macro" xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
    <mso:ribbon>
    <mso:qat>
    <mso:sharedControls>

    Is there any way to control these?

    Thank you!


    Tuesday, October 22, 2013 6:34 PM

Answers

  • Hi Natasha

    It's important to distinguish between Ribbon components that are part of Office, and those provided by an outside source.

    The controls that are exposed by the Office ribbons are "shared" in the sense that everyone can use the msoId for the command (and the image) to re-purpose them. Built-in tabs can be disabled and extended, but groups within them cannot be changed.

    Components provided by other sources are isolated - no one and nothing can work with their tabs, groups or controls. The only exception is if a third-party Ribbon XML uses a namespace and the idQ attribute in the Ribbon definition of a tab, group or control. In that case, anyone who has the namespace can also work with those Ribbon components that use the idQ attribute by also using that attribute.

    This is the ONLY way you can affect Ribbon controls provided by a third-party. This includes enabling/disabling or hiding controls.

    The only "contradicting" Ribbon controls possible are built-in controls where one add-in sets an attribute (visible, for example) and another sets it differently. In this case, the definition of the last add-in to load takes precedence.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Natasha A Friday, October 25, 2013 4:28 PM
    Friday, October 25, 2013 2:59 PM
    Moderator

All replies

  • To control them you would have to be able to open the code for those two add-ins.

    Kind Regards, Rich ... http://greatcirclelearning.com

    Wednesday, October 23, 2013 1:56 AM
  • I can open and view the code for them but any changes I make creates an error at loading, even if it's simply to set visible="false".

    How do I hide the entire Acrobat add-in tab through XML? We have a global template that loads at startup from where I'd like to hide these tabs.  I need the add-ins loaded because I decided to add the buttons I want from the add-in tab to the QAT.

    Thanks!



    • Edited by Natasha A Wednesday, October 23, 2013 5:13 PM Detail
    Wednesday, October 23, 2013 4:03 PM
  • Hi Natasha

    Exactly how do you "open and view the code for them"?

    By design, it's not possible for any code or configuration outside the one that defines a Ribbon customization to do anything with that customization. If you aren't the manufacturer of the software or don't have access to the Ribon XML, you can't customize it.

    If you want to have the Adobe add-in behave differently, the best course of action would be to contact Adobe and see what they say...


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, October 24, 2013 1:56 PM
    Moderator
  • Thank you for your response Cindy.

    To open the add-in I just right click and select to open it in Notepad. There is XML contained in the file and I can see the layout, but I can't control it, like you mentioned.

    Question then: What is the heirarchy of Ribbon XML control? What happens when there are contradicting Ribbon controls? The global template located in Startup has the ability to rewrite the entire ribbon, but it can't overwrite an add-in's control over the ribbon? I just want to turn visibility to false.

    I understand if it can't be done, I just want to be sure before giving up/trying something else.

    Thursday, October 24, 2013 4:21 PM
  • Hi Natasha

    It's important to distinguish between Ribbon components that are part of Office, and those provided by an outside source.

    The controls that are exposed by the Office ribbons are "shared" in the sense that everyone can use the msoId for the command (and the image) to re-purpose them. Built-in tabs can be disabled and extended, but groups within them cannot be changed.

    Components provided by other sources are isolated - no one and nothing can work with their tabs, groups or controls. The only exception is if a third-party Ribbon XML uses a namespace and the idQ attribute in the Ribbon definition of a tab, group or control. In that case, anyone who has the namespace can also work with those Ribbon components that use the idQ attribute by also using that attribute.

    This is the ONLY way you can affect Ribbon controls provided by a third-party. This includes enabling/disabling or hiding controls.

    The only "contradicting" Ribbon controls possible are built-in controls where one add-in sets an attribute (visible, for example) and another sets it differently. In this case, the definition of the last add-in to load takes precedence.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Natasha A Friday, October 25, 2013 4:28 PM
    Friday, October 25, 2013 2:59 PM
    Moderator
  • Hi Cindy,

    Thank you for shining light on the subject. Very interesting. I'll have to do some testing/exploring.

    I really appreciate your explanation, it's much clearer to me now!

    Friday, October 25, 2013 4:28 PM
  • Cindy,

    I have run into the same issue described by Natasha; however, even with the namespace and idQ from the Word.officeUI file (xmlns:x1="PDFMaker.OfficeAddin" and idQ="x1:tab1) I cannot get the "ACROBAT" tab to show in my startFromScratch="true" customization.

    I tried simply referencing the x1 namespace without the tab element, but the Acrobat tab did not show. The bare minimum tab element with visible="true" produces an error:

    "Setting properties in another add-ins controls is not supported: x1:tab1"

    Do you seen any hope here, or do I need to reconfigure to startFromScratch="false"?

    David Strickland

    Thursday, January 16, 2014 4:36 PM
  • Hi David

    The information you get from the user customization file is not going to help you with this. Firstly, PDFMaker.OfficeAddin is certainly not a namespace Adobe declared in its Ribbon customization. Secondly, I doubt very much whether Adobe set its controls up for sharing using idQ. It's not enough that you use idQ - the Ribbon you're trying to share also has to have used idQ.

    If you want to do this then you have to ask Adobe whether their Ribbon is set up for sharing and, if so, what the namespace is.


    Cindy Meister, VSTO/Word MVP, my blog

    • Proposed as answer by GrouseHiker Thursday, January 16, 2014 6:35 PM
    Thursday, January 16, 2014 6:31 PM
    Moderator