Outlook - export mail to text on rule of vba

前端 未结 1 1219
Happy的楠姐
Happy的楠姐 2021-01-28 12:38

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 i

1条回答
  •  悲哀的现实
    2021-01-28 13:23

    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.

    0 讨论(0)
提交回复
热议问题