Solved

Office ribbon merging tabs using xml namespace

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

685 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