Reputation: 533
I am implementing a new addin for Office 2010. How to add the context menu and the Ribbon tab in the same Ribbon.xml file? I tried adding the ribbon and the context menu in the same Ribbon_Load onAction, but the context menu is not created at all.
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load" loadImage="Ribbon_LoadImage">
<ribbon>
<tabs>
<tab idMso="TabAddIns">
<group id="groupExcel" label="Excel" keytip="P">
</group>
</tab>
</tabs>
</ribbon>
<contextMenus>
<contextMenu idMso="ContextMenuText">
<button idMso="FontDialog" visible="true" />
<toggleButton id="MyToggle" label="My Toggle Button" />
<button id="MyButton" label="My Button" insertBeforeMso="HyperlinkInsert" onAction="mycontent" />
<menuSeparator id="MySeparator" />
<menu id="MySubMenu" label="My Submenu" >
<button id="MyButton2" label="Button on submenu" />
</menu>
<dynamicMenu id="MyDynamicMenu" label= "My Dynamic Menu" getContent="GetMyContent" />
</contextMenu>
</contextMenus>
</customUI>
But I can see that the context menu is not loading nor visible in after clicking right on one of the cell. I am using .net c# 4.0 VSTO 2010
Please help me in this Thanks
Upvotes: 1
Views: 2126
Reputation: 533
I am able to achieve this.
<contextMenu idMso="ContextMenuText">
I changed ContextMenuText to ContextMenuCell.
<contextMenu idMso="ContextMenuCell">
Upvotes: 3