简体   繁体   English

Outlook如何知道是否已发送MSG文件?

[英]How does Outlook know if an MSG file has been sent?

If you start writing an email in Outlook and drag it from Drafts to your desktop, Outlook will open it with the Send button available and all fields modifiable. 如果您开始在Outlook中编写电子邮件并将其从“草稿”拖放到桌面,则Outlook将在“发送”按钮可用且所有字段都可修改的情况下打开它。

Likewise, if you drag a received email to your desktop, Outlook will open the MSG file in read-only mode. 同样,如果将收到的电子邮件拖到桌面,Outlook将以只读模式打开MSG文件。

I am hoping to add a feature in my c# application which can read a sent MSG file and then write it back in draft mode. 我希望在我的c#应用程序中添加一个功能,该功能可以读取已发送的MSG文件,然后以草稿模式将其写回。 So far I haven't had much luck finding any information on this. 到目前为止,我没有太多运气找到有关此的任何信息。

Outlook looks at the MSGFLAG_UNSENT bit in the PR_MESSAGE_FLAGS property (you can see it in OutlookSpy - click IMessage button for a message in one of the Outlook folders or OpenIMsgOnIStg button in case of a standalone MSG file). Outlook会查看PR_MESSAGE_FLAGS属性中的MSGFLAG_UNSENT位(您可以在OutlookSpy中看到它-单击IMessage按钮以获取Outlook文件夹之一中的消息,如果是独立MSG文件,则单击OpenIMsgOnIStg按钮)。

Outlook would not let you modify that flag - MailItem.Sent property is read-only. Outlook不允许您修改该标志-MailItem.Sent属性为只读。 Moreover, that bit can be set (if you are using Extended MAPI in C++ or Delphi) only before the message is saved for the very first time. 此外,只有在第一次保存消息之前,才可以设置该位(如果您在C ++或Delphi中使用扩展MAPI)。 That limitation does not apply to the standalone MSG file - MSGFLAG_UNSENT bit can be set or unset at any time. 该限制不适用于独立的MSG文件-可以随时设置或取消设置MSGFLAG_UNSENT位。

If using Redemption is an option, its RDOMail . 如果使用“ 兑换”是一个选项,则使用其RDOMail Sent property is read-write. Sent属性为可读写。 To open a standalone MSG file, you can use RDOSession . 要打开独立的MSG文件,可以使用RDOSession GetMessageFromMsgFile method (returns RDOMail object) - you can then modify the Sent property and call RDOMail.Save . GetMessageFromMsgFile方法(返回RDOMail对象)-然后,您可以修改Sent属性并调用RDOMail.Save

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

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