Hi David,
Do you mean you want your own Ribbon tab always be the 4th tab regardless
of what the Office application is and you want to achieve that with one
single ribbon XML file?
I took a look at the Ribbon XML schema, found no option for positioning the
tab using index.
The allowed attributes for the AG_PositionAttributes attributes group are:
insertAfterMso
insertBeforeMso
insertAfterQ
insertBeforeQ
All of them uses control ID for positioning.
You can get the schema here:
http://www.microsoft.com/downloads/details.aspx?familyid=15805380-f2c0-4b80-
9ad1-2cb0c300aef9&displaylang=en
A possible workaround would be:
1. In your single ribbon xml file, don't specify the MSO id directly, use a
placeholder instead.
2. In your add-in code, the GetCustomUI method, before you return the
ribbon xml to the Office application, you can replace the placeholder
string with the application's corresponding MSO ID on the fly, then feed
the xml string to Office.
For example:
Your single ribbon xml:
<Tab ... insertAfterMso="{NotDecided}" ...>
Your code in the GetCustomUI:
string ribbonXml = LoadRibbonXmlString();
switch (CurrentOfficeApplication)
{
case Word:
ribbonXml = ribbonXml.Replace("{NotDecided}", "TabPageLayout");
break;
case Excel:
ribbonXml = ribbonXml.Replace("{NotDecided}", "TabPageLayout");
break;
case PowerPoint:
ribbonXml = ribbonXml.Replace("{NotDecided}", "TabDesign");
break;
...
}
Please let me know whether or not this works for you.
Thanks,
Jie Wang
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.