将Outlook消息保存为具有单独附件的文件 [英] Saving outlook message as file with separate attachments

查看:152
本文介绍了将Outlook消息保存为具有单独附件的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在Outlook 2010 vba中编写代码,将电子邮件另存为msg文件以及任何附件。保存的消息不应包含附件。我似乎无法在不删除附件的情况下自行保存邮件 - 这会从电子邮件中删除
。  有没有办法制作副本该对象,以便实际的邮箱消息保持不变?提前致谢 -


下面的当前代码:

Current code below:

' save attachments
Set myattachments = oItem.Attachments
            For Each MyAttachment In myattachments
                 MyAttachment.SaveAsFile folderpath & sName & "\" & MyAttachment.FileName
                MyAttachment.Delete
            Next


        'save message
        oItem.SaveAs folderpath & sName & "\" & sName & Format(Now, "yyyy-mm-dd-hh-mm") & ".msg", olMSG




推荐答案

我不知道了解'未触动',但您可以将附件保存到单个文件中,将其从邮件中删除。保存邮件,然后重新添加。
I don't know about 'untouched', but you could save the attachments to individual files, remove them from the message. Save the message then add them back again.


这篇关于将Outlook消息保存为具有单独附件的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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