Outlook - 将邮件导出到vba规则上的文本 [英] Outlook - export mail to text on rule of vba

查看:156
本文介绍了Outlook - 将邮件导出到vba规则上的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何将电子邮件导出到我的c盘上的文本文件中,我知道如何



谢谢。

解决方案

div>

查看 MailItem.SaveAs 方法。您指定路径和文件类型。



例如:

 子SaveEmail()

Dim msg As Outlook.MailItem

'假设选择一个电子邮件
设置msg = ActiveExplorer.Selection.Item(1)

'另存为文本
msg.SaveAsC:\MyEmail.txt,olTXT

End Sub

文件类型是一个 OlSaveAsType 常量。在VBA编辑器中按F2,并将其粘贴到搜索框中以获取可能的值列表。


I am pretty sure that this has been done before.

Does anybody know how to export emails, into text files on to my c drive, i know how to move emails into other folders in outlook but on my c drive.

Thanks.

解决方案

Check out the MailItem.SaveAs Method. You specify the path and file type.

Ex:

Sub SaveEmail()

Dim msg As Outlook.MailItem

  ' assume an email is selected
  Set msg = ActiveExplorer.Selection.Item(1)

  ' save as text
  msg.SaveAs "C:\MyEmail.txt", olTXT

End Sub

The file type is a OlSaveAsType constant. Press F2 in the VBA Editor and paste this into the search box for the list of possible values.

这篇关于Outlook - 将邮件导出到vba规则上的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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