How to Quickly Export All Recent Emails You Haven’t Replied To in Outlook

Some users long for a solution to quickly find out and export the recent emails that they haven’t replied to. Therefore, this post will introduce a quick approach to you.

Inevitably, when you are too busy, you may miss some emails and do not reply to them in time. At this point, you may hope to quickly find out such emails. Yet, you must note that Outlook doesn’t provide such a search filter. But don’t worry. Here we will share you a method to search the recent emails you haven’t replied to and rapidly export them to Excel.

Quickly Export All Recent Emails You Haven't Replied To in Outlook

Export All Recent Emails You Haven’t Replied To

  1. To start with, launch your Outlook application.
  2. Then, in the main Outlook window, you should press “Alt + F11” key buttons.
  3. Next, you will get access to Outlook VBA editor window, in which you need to open an unused module.
  4. Subsequently, you ought to copy and paste the following VBA code into this module.
Dim objExcelApplication As Excel.Application
Dim objExcelWorkbook As Excel.Workbook
Dim objExcelWorksheet As Excel.Worksheet

Sub ExportEmailsNotReplied()
    Dim objInbox As Outlook.Folder
 
    Set objExcelApplication = CreateObject("Excel.Application")
    Set objExcelWorkbook = objExcelApplication.Workbooks.Add
    Set objExcelWorksheet = objExcelWorkbook.Worksheets(1)
 
    With objExcelWorksheet
         .Cells(1, 1) = "Subject"
         .Cells(1, 1).Font.Bold = True
         .Cells(1, 2) = "Received"
         .Cells(1, 2).Font.Bold = True
         .Cells(1, 3) = "Sender"
         .Cells(1, 3).Font.Bold = True
         .Cells(1, 4) = "Excerpts"
         .Cells(1, 4).Font.Bold = True
    End With
 
    objExcelApplication.Visible = True
    objExcelWorkbook.Activate
 
    Set objInbox = Application.Session.GetDefaultFolder(olFolderInbox)
    Call ProcessFolders(objInbox)
 
    With objExcelWorksheet
         .Columns("A:C").AutoFit
         .Rows.RowHeight = 15
         .Columns("D").ColumnWidth = 100
         .Columns("D").WrapText = False
    End With
 
    MsgBox "Complete!", vbExclamation
End Sub

Sub ProcessFolders(ByVal objCurrentFolder As Outlook.Folder)
    Dim i As Long
    Dim objMail As Outlook.MailItem
    Dim strReplied As String
    Dim nDateDiff As Integer
    Dim nLastRow As Integer
 
    For i = objCurrentFolder.Items.count To 1 Step -1
        If objCurrentFolder.Items(i).Class = olMail Then
           Set objMail = objCurrentFolder.Items(i)
 
           strReplied = objMail.propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x10810003")
           If (Not (strReplied = 102)) And (Not (strReplied = 103)) Then
 
              nDateDiff = DateDiff("d", objMail.SentOn, Now)
 
              If nDateDiff < 7 Then
                 nLastRow = objExcelWorksheet.Range("A" & objExcelWorksheet.Rows.count).End(xlUp).Row + 1
 
                 With objExcelWorksheet
                      .Cells(nLastRow, 1) = objMail.Subject
                      .Cells(nLastRow, 2) = objMail.ReceivedTime
                      .Cells(nLastRow, 3) = objMail.SenderName
                      .Cells(nLastRow, 4) = Left(Trim(objMail.Body), 100) & "..."
                 End With
             End If
          End If
        End If
    Next
 
    If objCurrentFolder.Folders.count > 0 Then
       For Each objSubfolder In objCurrentFolder.Folders
           Call ProcessFolders(objSubfolder)
       Next
    End If
End Sub

VBA Code - Export All Recent Emails You Haven't Replied To

  1. After that, you can run this macro by pressing “F5” key button or hitting the “Run” icon in the toolbar.
  2. At once, the macro will be triggered.
  3. Finally, when it finishes, you will get a message prompting “Complete”.
  4. Now, you could discover an Excel file open in the background, which contains the recent emails you haven’t replied to. It will look like the following image:Exported Emails

Reinstate Corrupted Outlook Files

Owing to Outlook’s vulnerability, you should take precautions to safeguard your Outlook data. For instance, you have to make backups on a regular basis. At the same time, you have to keep the computer far away from potential risk, such as viruses. Also, you had better keep a potent and reliable third party tool such as DataNumen Outlook Repair. It can perform proper Outlook repair with effortless ease.

Author Introduction:

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