VSTO Outlook 高级搜索中可用的所有属性
我在 C# 中将 VSTO 与 Outlook 2007 一起使用。我可以执行 Outlook.Application.AdvancedSearch() 并获取一个表。我想使用 Outlook.Table.Columns.Add() 从表中选择要访问的列。我似乎找不到可以传递给 Add() 的属性名称的完整列表(我只对邮件项目感兴趣)。我猜出了一些明显的(ReceivedTime、SenderEmailAddress、To、Subject、Body、EntryID)。我希望能够获取每封电子邮件的(纯文本)正文,但尝试添加属性正文似乎不起作用。是否不可能将 Body 作为列,或者只是使用不同的名称?
I'm using VSTO with Outlook 2007, in c#. I can execute an Outlook.Application.AdvancedSearch(), and get a table. I want to select the columns to access from the table using Outlook.Table.Columns.Add(). I can't seem to find a complete list of property names that I can pass to Add() (I'm only interested in mail items). I've guessed a few of the obvious ones (ReceivedTime, SenderEmailAddress, To, Subject, Body, EntryID). I was hoping to be able to get the (plain text) body of each email, but trying to add the property Body doesn't seem to work. Is it impossible to get Body as a column, or is it just under a different name?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
页面表对象或表过滤器中不支持的属性表示正文应该适用于前 255 个字节。这对我不起作用,但即使有用,那也不是我想要的。因此,我获取
EntryID
属性,然后使用mapiNameSpace.GetItemFromID(entryId, Type.Missing)
获取MailItem
对象,并获取来自MailItem.Body
的(整个)纯文本正文。The page Unsupported Properties in a Table Object or Table Filter says that Body should work for the first 255 bytes. That didn't work for me, but even if it did, that's not what I want. Thus, I get the
EntryID
property, then usemapiNameSpace.GetItemFromID(entryId, Type.Missing)
to get theMailItem
object, and get the (entire) plain-text body fromMailItem.Body
.