如何在邮件中添加 Outlook VSTO 2010 上下文菜单?

发布于 2024-11-19 07:03:19 字数 719 浏览 1 评论 0原文

我有一个 Outlook 2010 插件,我正在尝试创建一个自定义上下文菜单项。每当用户在消息正文中并右键单击时,我想让我的插件对所选文本执行一些操作。我有一个功能区栏,已经具有我想要的操作,但我不知道如何实际创建上下文菜单项。我找到了一些关于 MailItems 的教程,但它们似乎不适用于邮件正文。我不想使用 IContextMenuDisplay,因为它已被弃用。

有人可以帮忙吗?

我发现:

http:// /www.developerzen.com/2005/04/04/adding-a-button-to-outlooks-context-menu/ http://weblogs.asp.net/avnerk/archive/2007/01/03/vsto-for-outlook-2007-building-the-add-in-part-2.aspx http://www.roelvanlisdonk.nl/?p=1184

编辑:< /strong> 我发现邮件正文正在使用 Word 上下文菜单,这对于 Word 来说可能吗?

I have an Outlook 2010 addin, and I'm trying to create a custom context menu item. Whenever the user is in the Message body and right clicks, I would like to have my addin do some action on the selected text. I have a Ribbon bar that already has the actions I want, But I have no idea how to actually create the context menu item. I've found a couple tutorials for MailItems, but they do not seem to work within the message body. I do not want to use IContextMenuDisplay, because it is deprecated.

Can anyone be of assistance?

I've found:

http://www.developerzen.com/2005/04/04/adding-a-button-to-outlooks-context-menu/
http://weblogs.asp.net/avnerk/archive/2007/01/03/vsto-for-outlook-2007-building-the-add-in-part-2.aspx
http://www.roelvanlisdonk.nl/?p=1184

Edit: I've realized that the message body is using the Word context menu, is this possible with word?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风轻花落早 2024-11-26 07:03:19

使用它作为您的自定义上下文菜单 xml。
我很困惑,因为消息正文所需的 idMso 是 ContextMenuText,
而不是处理 Outlook 邮件的那些。

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
 <contextMenus>
<contextMenu idMso="ContextMenuText">
  <button idMso="FontDialog" visible="false" />
  <toggleButton id="MyToggle" label="My Toggle Button" />
  <button id="MyButton" label="My Button" insertBeforeMso="HyperlinkInsert" onAction="GetButtonID" />
  <menuSeparator id="MySeparator" />
  <menu id="MySubMenu" label="My Submenu" >
    <button id="MyButton2" label="Button on submenu" />
  </menu>
  <gallery id="galleryOne" label="My Gallery">
    <item id="item1" imageMso="HappyFace" />
    <item id="item2" imageMso="HappyFace" />
    <item id="item3" imageMso="HappyFace" />
    <item id="item4" imageMso="HappyFace" />
  </gallery>
  <dynamicMenu id="MyDynamicMenu" label= "My Dynamic Menu" getContent="GetMyContent" />
</contextMenu>
</contextMenus>
</customUI>

Use this as your custom context menu xml.
I was confused because the idMso needed for the message body is ContextMenuText,
instead of those dealing with outlook mailitems.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
 <contextMenus>
<contextMenu idMso="ContextMenuText">
  <button idMso="FontDialog" visible="false" />
  <toggleButton id="MyToggle" label="My Toggle Button" />
  <button id="MyButton" label="My Button" insertBeforeMso="HyperlinkInsert" onAction="GetButtonID" />
  <menuSeparator id="MySeparator" />
  <menu id="MySubMenu" label="My Submenu" >
    <button id="MyButton2" label="Button on submenu" />
  </menu>
  <gallery id="galleryOne" label="My Gallery">
    <item id="item1" imageMso="HappyFace" />
    <item id="item2" imageMso="HappyFace" />
    <item id="item3" imageMso="HappyFace" />
    <item id="item4" imageMso="HappyFace" />
  </gallery>
  <dynamicMenu id="MyDynamicMenu" label= "My Dynamic Menu" getContent="GetMyContent" />
</contextMenu>
</contextMenus>
</customUI>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文