Solved

Office ribbon merging tabs using xml namespace

Posted on 2011-09-27
5
1,134 Views
Last Modified: 2012-05-12
I have previously been able to use namespaces with the IdQ attribute in ribbon xml to allow different applications to share user-defined ribbon tabs and groups - an example:
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" xmlns:x="urn:ns:myNamespace">
  <ribbon>
    <tabs>
      <tab idQ="x:tabRibbon" label="Custom tab">
        <group idQ="x:groupLookupTool" label="Interactive Lookup Tool">
          <button id="btnFindCommand" label="Find a Command" size="large" imageMso="CreateReportFromWizard" screentip="Interactive Lookup Tool" supertip="Point at Excel 2002 buttons and commands to see them in Excel 2007" onAction="openApp" tag="C:\Program Files\Microsoft Office\Interactive Guides\Interactive - Excel 2003 to Excel 2007 command reference.exe"/>
        </group>
        <group idQ="x:groupTraining" label="Get Online Training">
          <button id="btnTraining" label="Up to Speed Course" size="large" imageMso="MovieFromFileInsert" screentip="Up to Speed Course" supertip="Learn quickly how to use Excel 2007." onAction="openPage" tag="http://office.microsoft.com/en-gb/training/HA102189871033.aspx"/>
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

Open in new window

Then other people can define similar xml using the same namespace and Excel will merge the groups correctly. This works fine when you can control the xml, but I have a developer using VS 2010 who has set up a complex ribbon using the ribbon designer, and does not want to redefine it using the xml file route.  
Is it possible using the visual designer to insert the correct namespace and idQ tabs to allow this sort of usage?
Alternatively, is there a simple way for him to export from the designer but still use the callbacks he has defined?
0
Comment
Question by:andrewssd3
  • 3
5 Comments
 
LVL 8

Accepted Solution

by:
jagrut_patel earned 250 total points
ID: 36709892
AFAIK, there are 2 ways to define a Ribbon in VS.
1. Visual designer
2. XML

So it should be possible to replace Visual Designer approach with XML file and thus achieve what you need.
0
 
LVL 17

Author Comment

by:andrewssd3
ID: 36710218
I'm not familiar with the visual designer route, but my preference would be for a solution that tells me how to add the namespace and idQ tags in the visual designer - I'm surprised you can't do this, but my developer tells me he can't find how to.  
If this is absolutely not possible I'd like to know the steps to convert a visually designed ribbon into an xml ribbon.  I've seen the export to xml option, but that doesn't seem to generate any code to hook up the callbacks, etc that have been defined for the visual version.
0
 
LVL 35

Assisted Solution

by:Miguel Oz
Miguel Oz earned 250 total points
ID: 36712938
Steps to export the file:
http://msdn.microsoft.com/en-us/library/bb386297.aspx

You need to add the code for the callbacks manually unfortunately. You may build a console app to automate this part if you really have many callbacks or it is a work in progress.
0
 
LVL 17

Author Comment

by:andrewssd3
ID: 36814703
Thank you both for your comments.  I want to do a bit more research myself on this tonight and I'll look at assigning points tomorrow.
0
 
LVL 17

Author Closing Comment

by:andrewssd3
ID: 36921221
Thanks - I've persuaded the developer to take the xml route, but your comments were helpful in eliminating the possibility of doing it via the visual designer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now