How to Quickly Attach Multiple Emails as .TXT Files to a New Outlook Email

If you would like to quickly convert multiple emails to .TXT files and then attach them in a new Outlook mail, you’d better utilize the way shared in this article. It can help you avoid the tedious steps.

By default, when you want to send multiple emails as attachments in a new mail, you can select all the source emails and then click “Forward” button. However, in this way, the source emails can be converted as .MSG attachments only. Therefore, if you wish to attach many emails as .TXT files in a new email, you can use the following means.

Quickly Attach Multiple Emails as .TXT Files to a New Outlook Email

Attach Multiple Emails as .TXT Files to a New Email

  1. At the very outset, start your Outlook program.
  2. After that, in the main Outlook window, press “Alt + F11” key buttons.
  3. Subsequently, you can find that you have accessed the Outlook VBA editor, in which you have to open a blank module.
  4. Then you could copy the following VBA code into this module window.
Sub SendMultipleEmails_AsTXTAttachments()
    Dim objSelection As Outlook.Selection
    Dim objSourceMail As Outlook.MailItem
    Dim objNewMail As Outlook.MailItem
    Dim strFileName, strFilePath As String

    'Get all selected emails
    Set objSelection = ActiveExplorer.Selection
 
    'Create a new email
    Set objNewMail = Application.CreateItem(olMailItem)
 
    If Not (objSelection Is Nothing) Then
       For Each objSourceMail In objSelection
 
           strFileName = objSourceMail.Subject
 
           strFileName = Replace(strFileName, "/", " ")
           strFileName = Replace(strFileName, "\", " ")
           strFileName = Replace(strFileName, ":", "")
           strFileName = Replace(strFileName, "?", " ")
           strFileName = Replace(strFileName, Chr(34), " ")

           strFileName = Format(objSourceMail.ReceivedTime, "YYYY-MM-DD") & "_" & strFileName & ".txt"
 
           'Save the selected emails as .TXT attachments
           strFilePath = "E:\" & strFileName
           objSourceMail.SaveAs strFilePath, OLTXT
 
           'Attach the .TXT files to the new mail
           objNewMail.Attachments.Add strFilePath
 
           'Delete the .TXT files
           Kill strFilePath
      Next
    End If
 
    'Change the following details as per your needs
    With objNewMail
         .Subject = "Temp Mail"
         .Body = "This is a test mail."
         .To = "boss@datanumen.com"
         .Recipients.ResolveAll
         .Importance = olImportanceHigh
         .Display
    End With
End Sub

VBA Code - Attach Multiple Emails as .TXT Files to a New Outlook Email

  1. Next, for later easy convenience, you are better off adding this new macro to Quick Access Toolbar. You can exit the VBA editor and go to “Outlook Options” to achieve it.
  2. Later you should alter Outlook macro security level to low.
  3. Eventually, you can have a try.
  • Firstly, select the emails which you want to send as .TXT attachments.
  • Then click on the macro in the Quick Access Toolbar.
  • At once, a new email, which contains the previously chosen mails as .TXT attachments, will display, like the screenshot below:Email Attached with Many .TXT Files

Combat against Outlook Corruption

Even though Outlook is feature rich, it still can become corrupted. Hence, users should make regular PST data backups and get hold of a well quality and reliable repair tool, like DataNumen Outlook Repair. It can repair PST file with minimized corruption in a jiffy.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql fix and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.