Outlook 2010 Context Menu For Embedded Attachments

2019-08-08 15:55发布

I am working on Otlook 2010 add-in and currently customizing Ribbon UI. So far so good, but I have one problem with customizing context menu for embedded objects in mails. I have tried many idMso context menus, but none of them is working.

Do anyone have experience which idMso is context menu shown below or how to add new button there?

enter image description here

Sample of my custom-ribbon.xml:

<?xml version="1.0" encoding="utf-8"?>
<customUI onLoad="OnRibbonLoad" xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <contextMenus>
    <contextMenu idMso="ContextMenuText">
      <button id="MyContextMenuText"
              imageMso="HappyFace"
              label="ContextMenuAttachments"
              onAction="OnMyButtonClick" />
    </contextMenu>
  </contextMenus>
</customUI>

1条回答
Evening l夕情丶
2楼-- · 2019-08-08 16:30

Your xml seems fine. But depending on what you click, there is a different context menu showing up.

The ContextMenuText is the context menu which shows up on right click when writing or editing email.

ContextMenuPicture is the context menu for right click on a picture.

And so on..

ContextMenus Add-In for Office 2010 Use this add-in to help determine the context menu names. After install the context menu name appears on the bottom of the menu.

Also make sure in the ThisAddIn.cs file, you have overridden the following method

protected override Office.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
    return new Ribbon1();
} 
查看更多
登录 后发表回答