Solved

Office ribbon merging tabs using xml namespace

Posted on 2011-09-27
5
1,160 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
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…

815 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

8 Experts available now in Live!

Get 1:1 Help Now