View Single Post
  #2  
Old October 3rd 06, 04:38 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default VBA: Moving item changes received date to now

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.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


" wrote:

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 = " Then

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

End If

Next


Ads