A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

VBA: Moving item changes received date to now



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 2nd 06, 11:53 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default 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

Ads
  #2  
Old October 3rd 06, 05: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


  #3  
Old October 3rd 06, 05:58 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default 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?

  #4  
Old October 3rd 06, 07:54 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default 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?



  #5  
Old October 3rd 06, 08:49 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

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?




  #6  
Old October 3rd 06, 09:36 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default 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 :-(

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get my correct date sent/received headers back? malarkey Outlook Express 8 August 28th 06 02:18 PM
Help moving message with VBA Murphybp2 Outlook and VBA 1 August 15th 06 08:01 AM
Moving data from Form Item to olMailItem djohnson Outlook - Using Forms 5 August 10th 06 06:41 AM
Group By Flag Status and then Received date [email protected] Outlook - General Queries 0 June 10th 06 01:53 AM
Exporting Date received and Date Sent to Access Sugarthebeet Outlook - General Queries 1 January 19th 06 09:06 PM


All times are GMT +1. The time now is 12:59 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-2025 Outlook Banter.
The comments are property of their posters.