将 Outlook ActiveExplorer 转换为 ActiveInspector
我有一些 C# 自动化代码,可以使用 Microsoft.Office.Interop.Word.Document 对象执行有趣的操作。通过 VSTO Outlook 插件创建的 ActiveInspector().WordEditor
Document doc = Globals.ThisAddin.Application.ActiveInspector().WordEditor;
会生成一个类似的 Document 对象,我可以将其与现有应用程序一起使用。当有可编辑的邮件项目(例如,新消息或回复)时,我可以使用 WordEditor。例如,我可以在收件箱中的邮件项目上使用 WordEditor 吗?
编辑 ---
进一步的调查使我得出以下结论:
Object selObject = Globals.ThisAddIn.Application.ActiveExplorer().Selection[1];
if (selObject is Outlook.MailItem)
{
Outlook.MailItem mailItem = (selObject as Outlook.MailItem);
Document doc = mailItem.GetInspector.WordEditor;
}
感谢 Paul-Jan 让我走上了正确的道路
I have some C# automation code which does interesting things with Microsoft.Office.Interop.Word.Document objects. The ActiveInspector().WordEditor created via
Document doc = Globals.ThisAddin.Application.ActiveInspector().WordEditor;
in a VSTO Outlook addin produces a similar Document object which I'm able to use with my existing application. I can get the WordEditor when there is an editable mail item (i.e. New message or Reply for example). Can I get a WordEditor on an mail item in the inbox, for example?
Edit ---
Further investigation has lead me to the following:
Object selObject = Globals.ThisAddIn.Application.ActiveExplorer().Selection[1];
if (selObject is Outlook.MailItem)
{
Outlook.MailItem mailItem = (selObject as Outlook.MailItem);
Document doc = mailItem.GetInspector.WordEditor;
}
Thanks to Paul-Jan for getting me on the right track
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,你的问题标题和内容都没有多大意义,真的。
活动检查器是 Outlook 中单个项目的视图。由于这些项目通常是 MailItems,可以使用 Word 进行编辑,因此您可以访问 Word 编辑器属性来使用它。
活动资源管理器是文件夹内容的视图。没有单一的项目,也没有文字编辑器。这和检查员是完全不同的概念。这是一对多。这是细节与大师的对比。你明白了。
希望事情能澄清一点。
No. Neither your question title nor the content makes much sense, really.
The active inspector is the view on a single item in Outlook. As those items are often MailItems, that can be edited with Word, there is a Word Editor property you can access to use it.
The active explorer is the view on the folder contents. There is no single item, nor is there a word editor. It's a completely different concept from an inspector. It's one versus many. It's detail versus master. You get the point.
Hope that clears things up a little.