使用 GetTable 时如何访问 Outlook 邮件消息的收件人?
为了提高性能,我使用 GetTable() 枚举 Outlook 邮件文件夹。这为我提供了 Row 对象的集合,我可以枚举这些对象来获取给定文件夹中的特定属性。在开始枚举之前,我可以使用表的 Columns 集合来控制结果中的列。总的来说,这工作得很好。但是,我不知道如何访问任何多值属性。具体来说,我无法为消息收件人返回任何值。
我已将收件人列添加到所需的列集中,但它始终返回空值。我已经检查了与 MFCMAPI 相关的消息,显然有收件人:-)
GetTable 的文档表示仅部分支持某些类型的列。它确实谈到了收件人:
返回对象的属性,例如附件、父项、收件人、 RecurrencePattern 和 UserProperties。
但它特别说:
如果属性通过其显式内置名称引用,则不支持; 如果属性由其命名空间引用,则受支持。
我正在使用其命名空间引用该属性(使用 Columns.Add): http://schemas.microsoft .com/mapi/proptag/0x0E12000D。但是,该值始终返回 null。
有问题!任何人都可以为我提供一个使用 GetTable 的收件人属性 (PR_MESSAGE_RECIPIENTS) 枚举收件人的示例吗?
For performance, I am enumerating an Outlook mail folder using GetTable(). This gives me a collection of Row objects I can enumerate to get specific properties in the given folder. I can control the coluumns in my result using the Columns collection of the Table before I begin enumerating. Overall, this works fine. However, I can't figure out how to access any of the multi-values properties. Specifically, the I can't get any values back for the recipients of the message.
I have added the recipients column to the desired set of columns, but it always comes back null. I have inspected the associated messages with MFCMAPI and clearly there are recipients :-)
The documentation for GetTable says that certain types of columns are only partially supported. It does talk about Recipients:
Properties returning an object, such as Attachments, Parent, Recipients,
RecurrencePattern, and UserProperties.
But it specifically says:
Not supported if property is referenced by its explicit built-in name;
supported if property is referenced by its namespace.
I am referencing the property (using Columns.Add) using its namespace: http://schemas.microsoft.com/mapi/proptag/0x0E12000D. However, the value always comes back null.
Something is wrong! Can anybody provide me with an example of enumerating through recipients using the recipients property (PR_MESSAGE_RECIPIENTS) with GetTable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来这是不可能的。请参阅此处的讨论:http: //social.msdn.microsoft.com/Forums/en-US/outlookdev/thread/dd2925c9-1128-461b-a291-8420597f4619
Looks like this is not possible. See discussion here: http://social.msdn.microsoft.com/Forums/en-US/outlookdev/thread/dd2925c9-1128-461b-a291-8420597f4619