MailItem.Move changes Received Date

  • Thread starter Thread starter Frank Perugini
  • Start date Start date
F

Frank Perugini

Hello All,

I have had some reports from a client that use a COM add-in that we
created that when it programatically moves messages to other folders,
that it modifies the received date (PR_MESSAGE_DELIVERY_TIME) to the
time that it was moved.

We could not duplicate this problem in any of our computers. Whether
moving from an Exchange folder to Exchange folder, or Exchange to a
PST. The add-in uses the OOM MailItem.Move() method to perform the
message move.

I finally created a small VB program and sent it to the client. It
allows them to pick a message, a destination folder, and a button to
perform the move. It captures the received date and modified date
before and after the move.

Sure enough, when the client ran the program and performed the move,
the received date was modified. This is definitely abnormal behavior.
Here's the relevant code that does the move:

Dim olDstFolder As Outlook.MAPIFolder

Set olDstFolder = objNS.GetFolderFromID(sDstEntryId, sDstStoreId)
objMailitem.Move olDstFolder

I can post the entire VB test app if necessary. It does require
Redemption.

Does any one have any idea why this is happening in certain
environments?

We are testing with Outlook 2003 SP2 and Exchange 2003. The client has
Outlook 2003 SP2 and Exchange 5.5 service pack 6a.

Has anyone experienced this problem?

-Frank
 
Outlook sometimes (I have no idea what the conditions are) returns a
non-critical error from Move (ignored by VB) that says something to the
extend that "the item could not be moved, it was created in the target
folder and the original was deleted".
If you are already using Redemption, try to use RDOMail.Move() instead - it
will preserve all dates as long as you are moving the message either within
the same store or between stores of a like kind (e,g, PST to PST).

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