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
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