Good day experts. Please help me in solving this issue.
I have a macro that will extract the subject and received date and EntryID from the mails to excel, but my requirement was,
(It should extract the subject and received date and time, content of the mail.) if subject and received date and time, content of the mail are same.. it should not be extracted to excel.. iam telling this condition to stop duplication of mail..
Please help me in doing this..
![]()
Sub ReadEmails() 'Stop Screen Updates Application.ScreenUpdating = False ' Then remember to run automatic calculations back on Application.Calculation = xlCalculationManual Application.EnableEvents = False 'set this to the folder Set Olf = CreateObject("Outlook.Application").GetNamespace("MAPI").Folders(1).Folders("inbox") i = Olf.Items.Count + 1 LR = Range("A65536").End(xlUp).Row r = 1 Do Until r = i subs = Olf.Items(r).Subject daterec = Olf.Items(r).ReceivedTime strID = Olf.Items(r).EntryID Worksheets("Sheet1").Cells(LR, 1).Value = subs Worksheets("Sheet1").Cells(LR, 2).Value = daterec Worksheets("Sheet1").Cells(LR, 3).Value = strID r = r + 1 LR = LR + 1 Loop 'Stop Screen Updates Application.ScreenUpdating = True ' Then remember to run automatic calculations back on Application.Calculation = xlCalculationAutomatic Application.EnableEvents = True End Sub
Bookmarks