Solved

Office ribbon merging tabs using xml namespace

Posted on 2011-09-27
5
1,213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 36

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

To Patch or not to Patch? That is the question!

Don't get caught out like thousands of others around the world in the recent Ransomware Fiasco!
Discuss..
- Why it's not a good idea to wait before Patching
- Sensible approaches to Patching discussed
- Add your feedback, comments and suggestions

Question has a verified solution.

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

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…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
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…

752 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