0

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.

ffmsingh
  • 141
  • 2
  • 6

1 Answers1

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.

JimmyPena
  • 8,694
  • 6
  • 43
  • 64
  • excellent thanks, How can you export specific line from the email to Excel. I get emails everyday. I want to export specific line of new data to bottom of column(last row) in excel. – user206168 Dec 30 '13 at 17:19