Search code examples
c#ribbonexcel-addins

C# Excel Addin Ribbon enabled on cell text right click


I am developing a Microsoft Excel Addin.

I need to add a button on context menu (right click) on cell selected text. I have found the ContextMenuCell idMso but this works only on whole cell right click.

Here is my ribbon's xml:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<ribbon>
</ribbon>
<contextMenus>
<contextMenu idMso="ContextMenuCell">
  <button id="TranslateTextButton" label="Test Label" onAction="OnRibbonClick" getImage="GetIcon"/>
</contextMenu>
</contextMenus>
</customUI>

I wonder if exists something like ContextMenuCell for cell's text and not whole cell. Thank you in advance!


Solution

  • After many searches I found ContextMenuFormulaBar which enables right click on formula bar and also in a cells inner (text etc.).