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
431 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,024 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,186 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
726 views
0 votes
0 answers

Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

Feb 17, 2022 in Others by Edureka
• 13,670 points
733 views
0 votes
1 answer

Remove formulas from all worksheets in Excel using VBA

Try this : Option Explicit Sub test1() ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,420 points
1,473 views
0 votes
1 answer

Calculate monthly average from daily data without PivotTable

Assuming you have the months in column D enter ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,420 points
1,325 views
0 votes
1 answer

Automate compound annual growth rate (CAGR) calculation

The following PowerPivot DAX formulas worked for ...READ MORE

answered Oct 7, 2022 in Others by narikkadan
• 63,420 points
1,011 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
2,179 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,125 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