将邮件项目标记为已发送(VBA前景) [英] Mark a mailitem as sent (VBA outlook)

查看:88
本文介绍了将邮件项目标记为已发送(VBA前景)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在更改邮件的已发送属性时遇到问题,因为该属性是只读的,因此需要从vba级别进行更改.

I have problem with change the sent property of mail, because the property is read-only and I need to change it from the level of vba.

从共享邮箱发送邮件(使用联机Outlook模式)后,出现问题.邮件不会转到共享邮箱中的已发送邮件"文件夹,而是保留在发件箱文件夹中.我已经制作了宏,可以将邮件移动到正确的文件夹,并且一切都很好,但是邮件的状态为未发送(当您打开mailitem时,您处于编辑模式).我找不到该问题的任何解决方案.

The problem appears after sent the mail from a shared mailbox (using online outlook mode). The mail doesn't go to folder "sent items" in shared mailbox but stay in outbox folder. I have made macro to move the mail to correct folder and everything is fine but the mail have status unsent (when you open the mailitem you are in editing mode). I can't find any solution for the problem.

这是发件箱文件夹,其中包含正确发送的邮件和从共享邮箱发送的邮件:

This is the outbox folder with correctly sent mail and mail sent from shared mailbox:

推荐答案

在低级(扩展MAPI)级别上,发送/未发送状态(PR_MESSAGE_FLAGS属性中的MSGFLAG_UNSENT位)只能在更改项目之前进行更改第一次保存.

On the low (Extended MAPI) level, send/unsent status (MSGFLAG_UNSENT bit in the PR_MESSAGE_FLAGS property) can only be changed before the item is saved for the very first time.

Outlook对象模型当然也受相同的限制,并且在发送状态下创建项目的唯一方法是创建PostItem对象-它是在发送状态下创建的.然后,您需要将消息类别更改回IPM.Note并删除与图标相关的属性,以确保该项目看起来正确.

Outlook Object Model is subject to the same limitation of course, and the only way to create an item in the sent state is to create a PostItem object - it is created in the sent state. You will then need to change the message class back to IPM.Note and remove the icon related properties to make sure the item looks right.

兑换可让您更改商品的状态(

Redemption lets you change the item's state (RDOMail.Sent is read/write until the first call to Save).

回到您的特定问题,您需要弄清楚为什么这些项目以未发送状态留在文件夹中,而不是尝试对其进行修复".

back to your particular problem, you need to figure out why the items is left in the folder in the unsent state, not try to "fix" it.

这篇关于将邮件项目标记为已发送(VBA前景)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆