I am trying to create a list on excel to track which of my selected sent outlook emails (moved to a particular sub folder, "Test") have been replied. For emails which have not been replied, I would like to send a reminder email after a few days. Would it be possible to create an outlook VBA macro to do this?
Currently, my VBA code is only able to pull selected email details in a tracking file.
I know that to track conversations, the PR_CONVERSATION_INDEX should be used, but am not sure how to incorporate it into my code below.
Sub List_Email_Info()
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Dim i As Long ' Row tracker
Dim arrHeader As Variant
Dim olNS As NameSpace
Dim olSentFolder As MAPIFolder
Dim olItems As Items
Dim olMailItem As MailItem
Dim olRecipients As Outlook.Recipients
arrHeader = Array("Date Created", "Subject", "Recipient's Name")
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWB = xlApp.Workbooks.Add
Set olNS = GetNamespace("MAPI")
Set olSentFolder = olNS.GetDefaultFolder(olFolderSentMail).Folders("test")
Set olItems = olSentFolder.Items
i = 1
On Error Resume Next
xlWB.Worksheets(1).Range("A1").Resize(1, UBound(arrHeader) + 1).Value = arrHeader
For Each olMailItem In olItems
xlWB.Worksheets(1).Cells(i + 1, "A").Value = olItems(i).CreationTime
xlWB.Worksheets(1).Cells(i + 1, "B").Value = olItems(i).Subject
xlWB.Worksheets(1).Cells(i + 1, "C").Value = olItems(i).To
i = i + 1
Next olMailItem
xlWB.Worksheets(1).Cells.EntireColumn.AutoFit
MsgBox "Export complete.", vbInformation
Set xlWB = Nothing
Set xlApp = Nothing
Set olItems = Nothing
Set olSentFolder = Nothing
Would appreciate any help on this!
========================================================================== Current code is adapted from: https://learndataanalysis.org/pull-outlook-emails-detail-into-excel-using-vba/