将属性添加到 MailItem 时,如何防止保存 Outlook MailItem 未保存的草稿?

发布于 2025-01-15 05:59:40 字数 358 浏览 3 评论 0原文

当人们开始在 Outlook 中撰写电子邮件时,它会以“未保存的草稿”的形式存在。如果您关闭电子邮件,系统会提示您保存/放弃草稿。在保存草稿之前,电子邮件不存在于草稿项目文件夹中。

我需要向未保存的草稿 MailItem 添加一个属性,并使 MailItem 保持未保存的草稿状态。不幸的是,使用 MailItem.Save 会导致MailItem 成为保存的草稿。

有没有办法阻止 MailItem 成为已保存的草稿或在保存后将其恢复为未保存的草稿?

When one begins composing an email in Outlook it exists as an "unsaved draft". If you close the email you are prompted to save/discard the draft. Until one saves the draft the email does not exist in one's draft items folder.

I need to add a property to an unsaved draft MailItem and for the MailItem to remain in an unsaved draft state. Unfortunately, using MailItem.Save results in the MailItem becoming a saved draft.

Is there a way to either prevent the MailItem from being a saved draft or to revert it to an unsaved draft after the save?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

长亭外,古道边 2025-01-22 05:59:40

捕获 MailItem.Write 事件并在事件处理程序中设置您的自定义属性。这样,只有在保存消息之前才会设置该属性。

Trap the MailItem.Write event and set your custom property in the event handler. This way the property will only be set only before the message is saved.

顾冷 2025-01-22 05:59:40

如果您关闭电子邮件,系统会提示您保存/放弃草稿。

您可以添加自定义属性并调用 Save 方法来避免出现此类对话框。

否则,请考虑将任何自定义数据保留在 Outlook 项目之外。它可以是数据库或任何其他存储,您可以在其中获取特定项目的数据。

If you close the email you are prompted to save/discard the draft.

You can add your custom property and call the Save method to avoid such dialogs.

Otherwise, consider keeping any custom data out of the Outlook item. It can be a DB or any other storage where you can grab the data for a particular item.

乄_柒ぐ汐 2025-01-22 05:59:40

我发现我可以向仅存在于内存中(未保存)的草稿 (MailItem) 添加一个属性,如果我不调用 MailItem.Write()MailItem.Save() 属性已添加且可访问,但草稿仍未保存。

如果草稿在某个时刻被保存(而不是被丢弃),则该属性将与 MailItem 的其余部分一起保留。

I found that I can add a property to a draft (MailItem) that exists only in memory (it is unsaved) and if I don't call MailItem.Write() or MailItem.Save() the property is added and accessible and the draft remaiins unsaved.

If the draft is saved (rather than discarded) at some point then the property is persisted along with the rest of the MailItem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文