Outlook 将已读回执存储为 ReportItem
对象。
是否有可能获得 ID
或者属于给定阅读回执的原始消息的一些细节?我已经浏览了 properties of the ReportItem
对象,但我迷路了。
由于已读回执有不同的形式,我不想以编程方式处理回执的正文 - 相反,如果可能的话,我希望从 Outlook 中获取它。
备注 :该解决方案应该至少适用于 Outlook 2003 到新版本。
最佳答案
看起来是ReportItem
之间的唯一链接和来源MailItem
是 ConversationIndex
和 ConversationTopic
.这是 Outlook 用来将已读回执消息与相关来源链接在一起的方式 MailItem
.您只需要filter by the ConversationTopic
然后 use the first 44 chars of the ConversationIndex
to identify the original source MailItem
.
示例对话索引
源码索引 :01CDC1C35624E2A7BD18CF8C439CA73B62A052922657
收据索引 :01CDC1C35624E2A7BD18CF8C439CA73B62A0529226570000012862
您可以使用 Items.Restrict
将项目减少到特定的 DASL 过滤器
DASL 搜索:[ConversationTopic] = 'read receipt ConversationTopic here'
定位 ReportItem 的父 MailItem
Outlook.MailItem source = FindReadReceiptSourceMessage(ri);
string entryID = source.EntryID;
// ...
public static Outlook.MailItem FindReadReceiptSourceMessage(Outlook.ReportItem readReceipt)
{
Outlook.Folder inbox = Globals.ThisAddIn.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) as Outlook.Folder;
string sourceIndex = readReceipt.ConversationIndex.Substring(0, 44);
string topicFilter = string.Format("[ConversationTopic] = '{0}'", readReceipt.ConversationTopic);
Outlook.Items topicItems = inbox.Items.Restrict(topicFilter);
return topicItems.OfType<Outlook.MailItem>().Where(c=>c.ConversationIndex.Equals(sourceIndex)).FirstOrDefault();
}
关于automation - 如何通过 Outlook 自动化获取属于已读回执 (ReportItem) 的 MailItem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13364815/