Outlook - export mail to text on rule of vba

大憨熊 提交于 2019-12-31 06:29:52

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/11647717/outlook-export-mail-to-text-on-rule-of-vba

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!