Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   VBA: Moving item changes received date to now (http://www.outlookbanter.com/outlook-vba/28732-vba-moving-item-changes-received.html)

jameshamilton777@hotmail.com October 2nd 06 10:53 PM

VBA: Moving item changes received date to now
 
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


Eric Legault [MVP - Outlook] October 3rd 06 04:38 PM

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



jameshamilton777@hotmail.com October 3rd 06 04:58 PM

VBA: Moving item changes received date to now
 
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 Streblechenko October 3rd 06 06:54 PM

VBA: Moving item changes received date to now
 
Is it being moved from an Exchange mailbox to PST? Or from one PST to
another PST?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

wrote in message
ps.com...
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?




Eric Legault [MVP - Outlook] October 3rd 06 07:49 PM

VBA: Moving item changes received date to now
 
FYI, my tests show no difference in either situation.

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


"Dmitry Streblechenko" wrote:

Is it being moved from an Exchange mailbox to PST? Or from one PST to
another PST?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

wrote in message
ps.com...
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?





jameshamilton777@hotmail.com October 3rd 06 08:36 PM

VBA: Moving item changes received date to now
 

Dmitry Streblechenko wrote:
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 :-(



All times are GMT +1. The time now is 07:25 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com