VBA How to extract the date and time of arrival of a answered email

0 votes

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.

Jan 9, 2023 in Others by Kithuzzz
• 38,010 points
2,174 views

1 answer to this question.

0 votes

Use MailItem.ReceivedTime property. I hope this helps you.

answered Jan 9, 2023 by narikkadan
• 63,420 points

Related Questions In Others

0 votes
1 answer

How to find the time complexity of a program?

Hi@akhtar, The first loop is O(N) and the ...READ MORE

answered Oct 15, 2020 in Others by MD
• 95,440 points
1,023 views
0 votes
1 answer
0 votes
1 answer

Excel VBA- How to loop through specific sheets in a workbook and format the same ranges in each sheet

Range(...) instructs VBA to always use the ...READ MORE

answered Mar 21, 2023 in Others by Kithuzzz
• 38,010 points
1,183 views
0 votes
1 answer

How to programmatically get the values of a spilled Excel range in VBA?

By using the Text property, I was ...READ MORE

answered Mar 23, 2023 in Others by narikkadan
• 63,420 points
723 views
0 votes
1 answer

Filter outlook sent items in vba failing for emails with multiple recipients

The PR DISPLAY TO parameter provides a ...READ MORE

answered Feb 21, 2023 in Others by narikkadan
• 63,420 points
469 views
0 votes
1 answer

Export Attachment from outlook to excel cells

You will need to save the attachment ...READ MORE

answered Apr 3, 2023 in Others by narikkadan
• 63,420 points
313 views
0 votes
1 answer

Embed picture in outlook mail body excel vba

The image needs to be added and ...READ MORE

answered Dec 16, 2022 in Others by narikkadan
• 63,420 points
4,553 views
0 votes
1 answer

Error populating email body from word documents

There is no need to use late ...READ MORE

answered Jan 15, 2023 in Others by narikkadan
• 63,420 points
961 views
0 votes
1 answer

VBA How to extract the date and time of arrival of a answered email

Use MailItem.ReceivedTime property. I hope this helps you ...READ MORE

answered Jan 9, 2023 in Others by narikkadan
• 63,420 points
430 views
0 votes
1 answer

How to increment the Range of a For Each loop - Excel VBA

Your formula seems to sum 1 single ...READ MORE

answered Jan 7, 2023 in Others by narikkadan
• 63,420 points
2,118 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP