I have a code that I use to extract data from Outlook to Excel. Can I also use this code to extract the date and time that the responded emails arrived?
This is used to track when an email was received, as well as when a response was given.
`Sub ExtraerEnviados()
Dim OutlookApp As Object
Dim ONameSpace As Object
Dim MyFolder As Object
Dim OItem As Object
Dim Fila As Integer
Set OutlookApp = CreateObject("Outlook.Application")
Set ONameSpace = OutlookApp.GetNamespace("MAPI")
'Set MyFolder = ONameSpace.GetDefaultFolder(olFolderInbox)
Set MyFolder = ONameSpace.Folders("xxxxxxxxxxxxxxxxx").Folders("sent items")
Range(Range("A2"), ActiveCell.SpecialCells(xlLastCell)).ClearContents
Fila = 2
For Each OItem In MyFolder.Items
On Error Resume Next
Sheets("sent items").Cells(Fila, 1).Value = OItem.SenderEmailAddress
Sheets("sent items").Cells(Fila, 2).Value = OItem.To
Sheets("sent items").Cells(Fila, 3).Value = OItem.Subject
Sheets("sent items").Cells(Fila, 4).Value = OItem.ReceivedTime--this is for element sent
Sheets("sent items").Cells(Fila, 5).Value = OItem.Categories
Sheets("sent items").Cells(Fila, 6).Value = OItem.<<I want to know when the item arrives in the inbox>>
Fila = Fila + 1
Next OItem
Set OutlookApp = Nothing
Set ONameSpace = Nothing
Set MyFolder = Nothing
End Sub`
I want you to assist me in finding a solution to this problem or recommend a different approach to this problem, so please let me know when the email arrived in your inbox and when an answer was sent.