简体   繁体   English

Outlook Interop,如何跟踪EntryId更改

[英]Outlook Interop, how to track EntryId change

I have following scenario: A small WPF app (a prototype, proof of concept) which is supposed to programmatically create an email (fill some data in), and track down if that email was replied later (conversation tracking). 我有以下情形:一个小型WPF应用程序(原型,概念证明),该程序应以编程方式创建电子邮件(填充一些数据),并跟踪是否稍后回复了该电子邮件(对话跟踪)。 Conversation ID is not available until item was sent. 发送项目之前,会话ID不可用。

The problem I faced is that when item is created and initially saved - it has one EntryId, but when item is sent, it is moved to another folder (and in case if there is more than one account, sent folder can be different from OlDefaultSent folder), when it is moved to another folder of an Exchange account its EntryId is changed, thus I am loosing a track of it. 我遇到的问题是,在创建和最初保存项目时-它具有一个EntryId,但是在发送项目时,它会移动到另一个文件夹(并且如果有多个帐户,则发送的文件夹可以不同于OlDefaultSent文件夹),当它移到Exchange帐户的另一个文件夹时,其EntryId会更改,因此我失去了它的踪迹。

Question is - how can I keep track of item I created when it is moved to a different folder (meaning EntryID is also changed)? 问题是-当我将创建的项目移动到另一个文件夹(意味着EntryID也已更改)时,该如何跟踪?

Second question here can be - how can I find my item if my app was closed while EntryId change happened? 这里的第二个问题是-如果在发生EntryId更改时关闭了我的应用程序,如何找到我的物品?

You can track the PR_SEARCH_KEY MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x300B0102 ) - it does not change when the message is moved between folders. 您可以跟踪PR_SEARCH_KEY MAPI属性(DASL名称为http://schemas.microsoft.com/mapi/proptag/0x300B0102当邮件在文件夹之间移动时,它不会更改。 You can retrieve the property using MailItem.PropertyAccessor.GetProperty, but Outlook Object Model won't let you search ( Items.Find ) on binary properties, you'd need Extended MAPI (C++ or Delphi) or Redemption for that. 您可以使用MailItem.PropertyAccessor.GetProperty来检索属性,但是Outlook对象模型不允许您在二进制属性中搜索( Items.Find ),因此需要扩展MAPI(C ++或Delphi)或兑现

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM