问题
now I am using ribbon to add a context menu item to the outlook reading pane. The xml is below:
<contextMenu idMso="ContextMenuReadOnlyMailText">
<menuSeparator id="separator"/>
<button id="contextMenuItem" label="Timezone Convertor" onAction="DoAction"/>
</contextMenu>
<contextMenu idMso="ContextMenuReadOnlyMailHyperlink">
<menuSeparator id="separator2"/>
<button id="contextMenuItem2" label="Timezone Convertor2" onAction="DoAction"/>
</contextMenu>
The idmso ContextMenuReadOnlyMailHyperlink
and ContextMenuReadOnlyMailText
works well. But I find sometimes if you right click inside a html table( which can be seen in the source view ), then the context menu item will not be shown.
I tried to use ContextMenuReadOnlyMailTable
or ContextMenuTable
. But it's not working.
Can someone help me on this?
And BTW, now I created the outlook 2013 add-in project in VS. After I publish it, can it be used for outlook 2010? Or I need to create the outlook 2010 project with the same code?
Thanks!
回答1:
Can someone help me on this?
Not all context menus can be customized by using the Ribbon UI (i.e. the Outlook extensibility model doesn't provide required IDs for that). See Extending the User Interface in Outlook 2010 for possible customizations.
After I publish it, can it be used for outlook 2010? Or I need to create the outlook 2010 project with the same code?
No, there is no need to create a new add-in project. You can run this add-in in Outlook 2010. Solutions that were created by using Visual Studio 2013, Visual Studio 2012 or Visual Studio 2010 can run in Office 2013, Office 2010, or the 2007 Microsoft Office system. However, the solution can use only those features and APIs that are available in all three versions of Office. You can read more about this in the Running Solutions in Different Versions of Microsoft Office article in MSDN.
回答2:
Adding answer for "Can someone help on this?" so that someone in need of solution for "adding context menu for selection inside a table inside mail" can benefit:
Following works like charm:
<contextMenu idMso="ContextMenuReadOnlyMailTextTable">
</contextMenu>
来源:https://stackoverflow.com/questions/28757454/add-context-menu-item-to-outlook2013-2010-reading-pane