Outlook超链接上下文菜单 [英] Outlook hyperlink context menu

查看:105
本文介绍了Outlook超链接上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为超链接创建上下文菜单.似乎有几个上下文可以拦截超链接事件-目前,我对带有idMso ="ContextMenuReadOnlyMailHyperlink"的上下文菜单感兴趣.

I'm trying to make a context menu for a hyperlink. It seems there are several contexts where hyperlink events can be intercepted -- at the moment I'm interested in the context menu with idMso="ContextMenuReadOnlyMailHyperlink".

可以使用两种不同方式执行此菜单中我的新按钮的回调-如果在Outlook的预览窗格中右键单击超链接,或者打开了电子邮件以在其自己的窗口中阅读.

There are two different ways the callback for my new button in this menu can be executed -- if hyperlink is right-clicked in the preview pane of Outlook, or if an email is opened for reading in its own window.

从预览窗格中调用时,我的回调收到一个Explorer COM对象.我假设资源管理器的ActiveInlineResponseWordEditor属性将以某种方式包含我选择的超链接,但是它将引发一个无用的COM异常(操作失败").

When invoked from preview pane, my callback receives an Explorer COM object. I assumed the Explorer's ActiveInlineResponseWordEditor property would contain my selected hyperlink somehow, but it throws a non-helpful COM exception ("The operation failed").

如何从此上下文中找到选定的超链接?

How can I find the selected hyperlink from this context?

还有,对于Inspector COM对象(当在其自己的窗口中从电子邮件中右键单击超链接时)如何处理?

Also, how about for the Inspector COM object (when hyperlink is right-clicked from email in its own window)?

推荐答案

我假设资源管理器的ActiveInlineResponseWordEditor属性将以某种方式包含我选择的超链接,但是它将引发一个无用的COM异常(操作失败").

I assumed the Explorer's ActiveInlineResponseWordEditor property would contain my selected hyperlink somehow, but it throws a non-helpful COM exception ("The operation failed").

ActiveInlineResponseWordEditor 属性未激活InlineResponse时不能使用.资源管理器的 InlineResponse 事件当用户执行使内联响应出现在阅读窗格"中的操作时,会触发此类.您的内联响应未激活.

The ActiveInlineResponseWordEditor property cannot be used when the InlineResponse is not activated. The InlineResponse event of the Explorer class is fired when the user performs an action that causes an inline response to appear in the Reading Pane. In your case the inline response is not activated.

如何从此上下文中找到选定的超链接?

How can I find the selected hyperlink from this context?

Explorer类提供选择属性,该属性返回一个Selection对象,其中包含在资源管理器窗口中选择的一个或多个项目.您可以使用Item方法(在C#中由索引器表示)从选择中获取Microsoft Outlook项目或对话标题.然后尝试将其强制转换为MailItem类并获取Inspector对象,请参见 GetInspector 方法. Inspector类提供了 WordEditor 属性,该属性返回正在显示的消息的Microsoft Word文档对象模型.您可以使用Word对象模型来获取选择.

The Explorer class provides the Selection property which returns a Selection object that contains the item or items that are selected in the explorer window. You can use the Item method (represented by the indexer in C#) to get a Microsoft Outlook item or conversation header from the selection. Then try to cast it to the MailItem class and get the Inspector object, see the GetInspector method of the MailItem class. The Inspector class provides the WordEditor property which returns the Microsoft Word Document Object Model of the message being displayed. You can use the Word object model to get the selection.

这篇关于Outlook超链接上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆