I have the following code that moves last months messages to an archive folder and I want it to leave the current months messages.
How do you read the "Received" field so that I can test the date?
If I can get the Subject, why can't I get the Date/Time? What am I doing wrong?
Thanks for any help you can provide.
How do you read the "Received" field so that I can test the date?
Code:
For Each objFolder In myNowFolder.Folders
Set myNewFolder = myNS.Folders("Mailbox - FMAAMON").Folders("Archive").Folders(strYear).Folders(strMonth).Folders.Add(objFolder)
Set myNowSubFolder = myNS.Folders("Mailbox - FMAAMON").Folders("Inbox").Folders("Monitoring").Folders(objFolder)
iMax = myNowSubFolder.Items.Count
For i = 1 To iMax
Set myItem = myNowSubFolder.Items(1)
Debug.Print myItem.Received '(this prints nothing)
If myItem. = strMonth Then
Debug.Print myItem.Subject '(this prints the subject line but it doesnt seem to need the .Subject)
myItem.Move myNewFolder
End If
Next i
Next objFolder
Thanks for any help you can provide.