Hello I Thought I had solved this in a previous post I had however its still not working. I have the code below to pull email info to excel, However, its not importing them from newest to oldest which is what Im needing.
I have tried adding
Set olfoder = Items.Sort("[ReceivedTime]", False) after
For Each xMailItem In olFolder.Items
still no luck.
below is part of the code, however I have the rest of the code in the following link HERE.
I have tried adding
Set olfoder = Items.Sort("[ReceivedTime]", False) after
For Each xMailItem In olFolder.Items
still no luck.
below is part of the code, however I have the rest of the code in the following link HERE.
VBA Code:
For Each xMailItem In olFolder.Items
Set xDoc = xMailItem.GetInspector.WordEditor
For I = 1 To xDoc.Tables.Count
Set xTable = xDoc.Tables(I)
xTable.Range.Copy
xWs.Range("Y1").Select
xWs.Paste
Range("X1").Offset(I, 0).Value = xMailItem.ReceivedTime
Range("X1").Offset(I, 0).Columns.AutoFit
Range("X1").Offset(I, 0).VerticalAlignment = xlTop
Next
Call EmailCopy
Next
I = I + 1
Set Folder = Nothing
Set OutlookNamespace = Nothing
Set OutlookApp = Nothing
Range("X:AH").ClearContents
Call TextToNumbers
MsgBox "ALL BIDS FROM EMAIL HAVE BEEN IMPORTED.", vbOKOnly
End If
End Sub