Setting our tab in the menu to be 4th

D

David Thielen

Hi;

We use the same menus in Word, Excel, & PowerPoint. And we don't want
to do different ones for each because we presently have 3 complete
menus for each language, and 4 languages and countins. Different menus
would switch us from 12 menus to 36.

But the positioning appears to be set based on the MSO or tag names of
the tab you want to go after. And that is different in each app. Is
there a way to just say make us the 4th tab? That seems to be the
natural location for us for all 3 apps.

thanks - dave


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Jie Wang [MSFT]

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.
 
D

David Thielen

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.

That's a PITA but it works - thanks - dave


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top