问题
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