为 Outlook 2010 构建上下文菜单插件

Bulding a context menu addin for Outlook 2010

这将是一个有点新手的问题,虽然有些页面试图在给定主题上启发我,但其中 none 对新手来说足够友好。

所以我转向你们。

我的任务是为 Outlook 2010 构建一个简单的插件,用户可以在其中右键单击一封电子邮件,然后打开一个新的 window 选项。到目前为止,我不太关心 window 的内容,只是客户可以右键单击电子邮件打开它。

我手头的工具是 MS Visual Studio、Outlook 2010 和我的 C# 技能。

请注意,我并不是要你们我完成任务,只是帮助我开始?

如果有人可以快速演示,我想要一些关于如何将上下文菜单添加到 Outlook 的示例代码?

非常感谢你!

嗨,如果您正在制作商业产品,我强烈建议您购买 https://www.add-in-express.com/ 它会让您的生活变得更加轻松。 dll 包装 office 对象,同一行代码将适用于 office 2003-2013。

看这里

https://www.add-in-express.com/creating-addins-blog/2011/02/07/office-shared-addin-task-panes-outlook-regions/

继续回答我自己的问题,因为一些谷歌搜索和一些愚蠢的实验让我得到了一个像样的按钮。

最后,我在这里得到了很多来自微软的解决方案:https://msdn.microsoft.com/en-us/library/dd554969.aspx

如果你想创建一些基本的上下文菜单,当然值得一读,而且你和我一样菜鸟。

我建议从 MSDN 中的 Walkthrough: Creating Your First Application-Level Add-in for Outlook 文章开始。

Fluent UI(又名功能区 UI)用于自定义 Outlook 中的上下文菜单。 Extending the User Interface in Outlook 2010 and Customizing Context Menus in Office 2010 articles in MSDN describe all the required steps for custiomizing context menus in Outlook/Office. Pay special attention to the Context Menu for a Mail Item 部分。当 Outlook 显示以下上下文菜单时,表示在当前视图中选择了一个邮件项目:

<contextMenus>    
  <contextMenu idMso="ContextMenuMailItem">
    <button id="MyContextMenuMailItem"
        label="ContextMenuMailItem"
        onAction="OnMyButtonClick"/>
   </contextMenu>  
</contextMenus>

当 Outlook 显示以下上下文菜单时,在当前视图中选择了多个项目。

<contextMenus>    
  <contextMenu idMso="ContextMenuMultipleItems">
    <button id="MyContextMenuMultipleItems"
        label="ContextMenuMultipleItems"
        onAction="OnMyButtonClick"/>
  </contextMenu>  
</contextMenus>

您可以在 MSDN 中的以下系列文章中阅读有关功能区 UI 的更多信息: