views:

354

answers:

1

I have a .net addin for Excel. The addin creates the Ribbon UI for Excel 2007 and re-purposes some existing commands such as Cut, Copy, Paste, Sort etc.

For Cut, Copy and Paste I am just overriding their OnAction value to call my own procedure when the buttons are clicked. But for Sort, Sort Asc and Sort Desc commands the case is a little different. When either of the Sort, Sort Asc or Sort Desc buttons are clicked, I want to get notified and then call the default functionality. This was possible in Excel 2003 commandsbars by calling the Execute() method on the CommandBarControl.

In Excel 2007, there is a ExecuteMso() method to programmatically click a ribbon element but when the OnAction is overridden, this ExecuteMso() method just executes my own procedure and not the default functionality of that button.

So I thought that I will HIDE the Sort buttons in the "Editing" group in Home tab and add my own Sort, Sort Asc and Sort Desc buttons to it. The buttons will call into my procedure first from where I will call the default behavior.

Now the problem is that I am unable to change/hide the Editing group (idMso="GroupEditing"). Is this built-in group not editable? I can however HIDE the Clipboard and other groups(but can't add buttons to them).

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"&gt;
  <ribbon>
    <tabs>
      <tab idMso="TabHome">        
        <group idMso="GroupEditing" visible="false" />
      </tab>
    </tabs>
  </ribbon>
</customUI>
+1  A: 

Hi,

I think the idMso is incorrect in relation to hiding the Editing group.

idMso="GroupEditingExcel"

Andy Pope
Thanks very much Andy. I am able to hide the "Editing" group using the "GroupEditingExcel" id. Can you give me a link where I can find these Ids? Also, I tried "GroupClipboardExcel" and it did not work for the "Clipboard" group BUT "GroupClipboard" worked... strange no? Why do dome Ids have a Excel suffixed?
A9S6
Although I solved the problem using the "ref bool cancelDefault" parameter of the handler method, I will mark this as the answer because it actually answers one of my issues in the main question
A9S6