Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Outlook Message Received Time

Status
Not open for further replies.

mrgulic

Technical User
Sep 18, 2001
248
US
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?

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
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.
 
And this ?
Debug.Print myItem.ReceivedTime

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That worked great. I tried
.Recieved
.TimeRecieved
.ReceivedDate
but never thought about .ReceivedTime
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top