如何从 VSTO 加载项获取阅读窗格引用?
如何获取对 Outlook 中阅读窗格的引用?如何添加一个事件处理程序来通知阅读窗格的内容发生变化?
据我所知,Oulook 并不认为阅读窗格是一个检查器。当 ThisAddIn_Startup 被触发时,Application.Inspectors.Count 为 0,InspectorsEvents_NewInspectorEventHandler 也不会被触发。
我想知道的是消息何时加载到阅读窗格中并获取对该消息的引用(即发件人的电子邮件地址)。
似乎是一个简单的任务,但我在互联网上找不到单个示例。
How do you get a reference to a Reading Pane in Outlook? And how do you add an event handler to be notified with the content of the reading pane changes?
As far as I can see, Oulook doesn't consider Reading Pane as an Inspector. When ThisAddIn_Startup is fired, Application.Inspectors.Count is 0, InspectorsEvents_NewInspectorEventHandler also doesn't get fired.
All I want to know is when the message is loaded in the Reading Pane and get a reference to that message (i.e. sender's email address).
Seems like a simple task, but I can't find a single example on the Internet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“ReadingPane”是指 Outlook 主窗口中显示当前所选 Outlook 消息的窗格吗?
如果是这样,我不相信您直接访问该窗格,而是查询活动文件夹和该文件夹中选定的消息,然后直接对消息进行操作。
By "ReadingPane" do you mean the pane in the main outlook window that displays the currently selected outlook message?
If so, I don't believe you access the pane directly, instead you query for the active folder and the selected message within that folder and then operate on the message directly.
请注意,所选消息并不总是阅读窗格中的消息。
如果您正在操作上下文菜单,
ActiveExplorer()
.Selection 将包含上下文菜单正在操作的项目,而不是在阅读窗格中选择的项目。Be careful, the selected message is not always the message in the reading pane.
If you are manipulating context menus,
ActiveExplorer()
.Selection will contain the item the the context menu is acting on, instead of the item selected in the reading pane.