I have a ribbon that I need to position after the HomeTab (or any other built-in tab) in Word. But Word seems to ignore the insertAfterMso
(and insertBeforeMso
) attributes.
I tried using insertAfterQ
/insertBeforeQ
as well, but I can't get those to work with the built-in tabs.
<customUI
onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui"
xmlns:cstm1="myns"
xmlns:cstm2="myns2">
<ribbon>
<tabs>
<tab
idQ="cstm1:MyCustomTab"
label="My Custom Tab"
getVisible="MyCustomTab_getVisible"
insertAfterMso="HomeTab">
</tabs>
</ribbon>
</customUI>
I suspect it might be related to the use of the idQ
attribute, but I need that feature, so I can't remove it :-/
Note that the tab is displayed on the Office ribbon, but it's at the far right end of the ribbon, as it would be without the insertAfterMso attribute added.
The reason to use the idQ
attribute to identify the tab, instead of the regular id
attribute, is when more than one VSTO AddIn needs to modify the content of a specific tab.
It turns out that if you want control the position of the tab, by using the insertAfterMso
or insertBeforeMso
attributes, you need to do so in all AddIns modifying the target tab - adding that attribute to just one of the AddIns is not enough in all situations.
I suspect the same is the case if you are using insertAfterQ
and insertBeforeQ
.
AddIn loading order can play a role in whether or not you experience this or not.
So my markup was initially correct - but it was being "sabotaged" by my secondary VSTO AddIns.