Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Manually change 'Date Sent', 'Date received' in messages ... how ? (http://www.outlookbanter.com/outlook-vba/43992-manually-change-date-sent-date.html)

baxe0 March 21st 07 02:47 PM

Manually change 'Date Sent', 'Date received' in messages ... how ?
 
For uniformity reasons and to have better grip on my correspondence, I want
to store my messages, text, articles received not by internet but on paper in
Outlook after scanning/ OCR them.

I can create a new message from the scanned text. Of course I want to
timestamp these artificial Outlook messages properly, so I can retrieve/
categorize/ index them easily (e.g. with Windows Desktop Search).

Thus in must change 'Date Sent', 'Date received' manually in thes
'fake'messages.

Does any know a way or a program (Visual Basic) to do this. At present I do
not master Visual Basic so I can write it myself.

Erik

--
I always think hard before I say something stupid

Michael Bauer [MVP - Outlook] March 22nd 07 06:11 AM

Manually change 'Date Sent', 'Date received' in messages ... how ?
 


Erik, you can do that manually with the Redemption from www.dimastr.com.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Wed, 21 Mar 2007 07:47:18 -0700 schrieb baxe0:

For uniformity reasons and to have better grip on my correspondence, I

want
to store my messages, text, articles received not by internet but on paper

in
Outlook after scanning/ OCR them.

I can create a new message from the scanned text. Of course I want to
timestamp these artificial Outlook messages properly, so I can retrieve/
categorize/ index them easily (e.g. with Windows Desktop Search).

Thus in must change 'Date Sent', 'Date received' manually in thes
'fake'messages.

Does any know a way or a program (Visual Basic) to do this. At present I

do
not master Visual Basic so I can write it myself.

Erik


stevemanser September 15th 15 01:02 PM

This is a script that I wrote that will run through a folder of .msg files and replace the email “Received Date” with the original date, because sometimes copying or moving an email using POP3 or IMAP will set a new creation date that Outlook will then display, so you get a mailbox full of emails that are the same date. You may need to change the "X-MDArrival-Date:" to whatever it is in your mail system. I’ve also packaged the VBA into an Access Database File he http://www.brightnet.co.uk/archives/1333


Private Sub ReplaceEmailReceivedDateWithDeliveryDate(strPath As Variant)
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
If IsNull(strPath) Then strPath = "C:\"
Set objFolder = objFSO.GetFolder(strPath)
For Each objFile In objFolder.Files
strFile = objFile.Name
If Right(strFile, 4) = ".msg" Then
strTemp = strFile & ".tmp"
'read existing file
Set objFile = objFSO.OpenTextFile(strPath & strFile, ForReading)
strText = objFile.ReadAll
objFile.Close
If InStr(strText, "X-MDArrival-Date:") Then
'make new file
Set tmpFile = objFSO.CreateTextFile(strPath & strTemp, True)
arrLines = Split(strText, vbCrLf)
For i = 0 To (UBound(arrLines))
If Left(arrLines(i), 17) = "X-MDArrival-Date:" Then
vLine1 = arrLines(i)
strDate1 = Mid(arrLines(i), 19)
End If
If Left(arrLines(i), 14) = "Delivery-Date:" Then
vLine2 = arrLines(i)
strDate2 = Mid(arrLines(i), 16)
End If
Next
If Not IsEmpty(vLine1) Then
For i = 0 To (UBound(arrLines))
If Left(arrLines(i), 17) = "X-MDArrival-Date:" Then
arrLines(i) = Replace(arrLines(i), vLine1, Replace(vLine2, "Delivery-Date:", "X-MDArrival-Date:"))
End If
If InStr(arrLines(i), strDate1) Then arrLines(i) = Replace(arrLines(i), strDate1, strDate2)
tmpFile.WriteLine arrLines(i)
Next
tmpFile.Close
objFSO.DeleteFile strPath & strFile, True
objFSO.MoveFile strPath & strTemp, strPath & strFile
End If
End If
End If
NextRow = NextRow + 1
Next objFile
End Sub


All times are GMT +1. The time now is 04:09 AM.

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