VBA: Moving item changes received date to now

  • Thread starter Thread starter jameshamilton777
  • Start date Start date
J

jameshamilton777

I have simple code that moves messages into another PST file. But each
message moved gets it's received date changed to the current date time
which is useless. Any workarounds? Thanks, James.

Dim objOutlookApplication As Application
Dim objNameSpace As NameSpace
Dim objInbox As MAPIFolder
Dim objMessage As MailItem

Set objOutlookApplication = CreateObject("Outlook.Application")
Set objNameSpace = objOutlookApplication.GetNamespace("MAPI")
Set objInbox = objNameSpace.GetDefaultFolder(olFolderInbox)

For Each objMessage In objInbox.Items

If objMessage.SenderEmailAddress = "(e-mail address removed)" Then

objMessage.Move objNameSpace.Folders("Example
Folder").Folders("Subfolder")

End If

Next
 
Strange, I'm not experiencing that behaviour. Are you sure you're not
looking at the Modified field in the view? That will get timestamped when
the message is moved; all others (Received, Sent, Created) should retain the
original value.
 
Yes, it is the Received field that is changed. I've seen similar
reports on other forums. I'm using Outlook 2003. Might have something
to do with the email being moved to a separate PST file?
 
Dmitry said:
Is it being moved from an Exchange mailbox to PST? Or from one PST to
another PST?

It's being moved from one PST to another, both of which are "open" in
my Outlook session.

I know others have seen this problem but it must be rare. Wonder why
I've caught it :-(
 
Back
Top