每当发送电子邮件时,我都希望执行一些操作(我们通过单击出现在撰写电子邮件窗口的功能区中的某个按钮来激活此操作)。 我认为此操作需要从已发送的项目中执行。
所以,我想创建一个表或一个简单的列表来存储发送电子邮件时的 ID(或唯一的东西)。然后每当一封电子邮件出现在已发送文件夹中时,我将检查它是否在我们之前创建的列表或表格中。
所以,
如何创建、添加数据到那些表?
这是对已发送的项目执行操作的好方法吗?
- 在撰写电子邮件“mailitem”和发送电子邮件“mailitem”之间是否有任何独特和共同的元素(如一些 id)?
谢谢。
请您参考如下方法:
你说的是什么表?
何时执行操作由您决定。我在您的帖子中没有看到足够的信息来提出其他建议。如果您想获得有值(value)的反馈,我建议您深入描述您的最终目标。但是,您也可以考虑处理 Application 类的 ItemSend 事件。
Outlook 使用 EntryID用于标识项目的属性值(字符串)。以下是 MSDN 对条目 ID 的说明:
A MAPI store provider assigns a unique ID string when an item is created in its store. Therefore, the EntryID property is not set for an Outlook item until it is saved or sent. The Entry ID changes when an item is moved into another store, for example, from your Inbox to a Microsoft Exchange Server public folder, or from one Personal Folders (.pst) file to another .pst file. Solutions should not depend on the EntryID property to be unique unless items will not be moved.
但是您可以自由添加自己的 ID。您可以使用用户属性来存储它们。有关详细信息,请参阅 Outlook 项目的相应属性 (UserProperties)。
