Can't modify PR_CLIENT_SUBMIT_TIME?

  • Thread starter Thread starter Burma
  • Start date Start date
Status
Not open for further replies.
B

Burma

I have a bunch of messages that are missing PR_CLIENT_SUBMIT_TIME. They

show "None" in Outlook's Sent column. I thought the code below should

do the trick but, although it runs without error, the messages with

"None" for the Sent date don't get modified. PR_MESSAGE_DELIVERY_TIME

is not missing for these messages. Is there something else i need to

do? Thanks

Sub FixDates()

On Error GoTo ErrorHandler

Dim ol As New Outlook.Application

Dim cfolder1 As MAPIFolder

Dim sItem As Redemption.SafeMailItem

Const cdoPR_CREATION_TIME = &H30070040

Const cdoPR_LAST_MODIFICATION_TIME = &H30080040

Const cdoPR_CLIENT_SUBMIT_TIME = &H390040 '0x00390040

Const cdoPR_MESSAGE_DELIVERY_TIME = &HE060040 '0x0E060040

Const cdoPR_TRANSPORT_MESSAGE_HEADERS = &H7D001E '0x007D001E

Set cfolder1 = ol.Session.PickFolder

If cfolder1 Is Nothing Then Exit Sub

Set sItem = CreateObject("Redemption.SafeMailItem")

For Each Item In cfolder1.Items

sItem.Item = Item

With sItem

If IsNull(.Fields(cdoPR_CLIENT_SUBMIT_TIME)) Or _

IsEmpty(.Fields(cdoPR_CLIENT_SUBMIT_TIME)) Then

If Not IsNull(.Fields(cdoPR_MESSAGE_DELIVERY_TIME)) And _

Not IsEmpty(.Fields(cdoPR_MESSAGE_DELIVERY_TIME)) Then

> Fields(cdoPR_CLIENT_SUBMIT_TIME) =

> .Fields(cdoPR_MESSAGE_DELIVERY_TIME)

End If

> Save

End If

End With

Next Item

Exit Sub

ErrorHandler:

MsgBox Err.Number & vbNewLine & Err.Description

Set cfolder = Nothing

Set ol = Nothing

End Sub
 
See my reply in the mapi newsgroup. Please do not multipost.

Dmitry Streblechenko (MVP)

-

"Burma" <somebody@somedomain.com> wrote in message

news:uREicwPqJHA.3364@TK2MSFTNGP06.phx.gbl...

> I have a bunch of messages that are missing PR_CLIENT_SUBMIT_TIME. They
> show "None" in Outlook's Sent column. I thought the code below should do
> the trick but, although it runs without error, the messages with "None"
> for the Sent date don't get modified. PR_MESSAGE_DELIVERY_TIME is not
> missing for these messages. Is there something else i need to do? Thanks

> Sub FixDates()

> On Error GoTo ErrorHandler

> Dim ol As New Outlook.Application
> Dim cfolder1 As MAPIFolder
> Dim sItem As Redemption.SafeMailItem

> Const cdoPR_CREATION_TIME = &H30070040
> Const cdoPR_LAST_MODIFICATION_TIME = &H30080040
> Const cdoPR_CLIENT_SUBMIT_TIME = &H390040 '0x00390040
> Const cdoPR_MESSAGE_DELIVERY_TIME = &HE060040 '0x0E060040
> Const cdoPR_TRANSPORT_MESSAGE_HEADERS = &H7D001E '0x007D001E

> Set cfolder1 = ol.Session.PickFolder
> If cfolder1 Is Nothing Then Exit Sub
> Set sItem = CreateObject("Redemption.SafeMailItem")
> For Each Item In cfolder1.Items
> sItem.Item = Item
> With sItem
> If IsNull(.Fields(cdoPR_CLIENT_SUBMIT_TIME)) Or _
> IsEmpty(.Fields(cdoPR_CLIENT_SUBMIT_TIME)) Then
> If Not IsNull(.Fields(cdoPR_MESSAGE_DELIVERY_TIME)) And _
> Not IsEmpty(.Fields(cdoPR_MESSAGE_DELIVERY_TIME)) Then
> .Fields(cdoPR_CLIENT_SUBMIT_TIME) =
> .Fields(cdoPR_MESSAGE_DELIVERY_TIME)
> End If
> .Save
> End If
> End With
> Next Item

> Exit Sub

> ErrorHandler:
> MsgBox Err.Number & vbNewLine & Err.Description
> Set cfolder = Nothing
> Set ol = Nothing

> End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
B Modify VBA to create a RULE to block multiple messages Outlook VBA and Custom Forms 0
S Macro to extract and modify links from emails Outlook VBA and Custom Forms 3
R Outlook 2010 Modify Style "Do not check spelling or grammar" not saving Outlook VBA and Custom Forms 0
O modify vba to run it as script rule Outlook VBA and Custom Forms 8
Justo Horrillo It's possible to modify the behaviour of the conversation option? Using Outlook 2
S Modify account template? BCM (Business Contact Manager) 0
R Can't modify Outlook view font with IE anymore (even though IE still affects print font) Using Outlook 5
smokiibear How to modify Today Page to Include tasks from other task folders Using Outlook 1
S Modify recurring outlook invites based on form entry Using Outlook 0
S VBA to modify appointment item in additional Exchange account doesn't work Using Outlook 0
C How To Open Outlook Attachment in Excel, Modify some Data, then Re-Save It Using Outlook 3
A Possible to modify people preview window? Using Outlook 1
R How to modify Outlook Select Rooms form columns Using Outlook 1
G Modify Subject line of incoming mail where I am in Cc line Using Outlook 1
N modify New mesage SEND button Outlook VBA and Custom Forms 1
R Custom Archive code -- modify my code! Outlook VBA and Custom Forms 3
C How do I grab a field property (like .value) so I can modify it via OL code? Outlook VBA and Custom Forms 4
A Script to either modify "from" address or prevent a reply being se Outlook VBA and Custom Forms 2
M Thunderbird email client - I wonder Using Outlook 1
W Outlook 365 I am getting the "Either there is no default mail client" error when I try to send an email on excel Office 365 Using Outlook 1
S client lost 3K contacts when office 365 for mac account deleted from company exchange server Using Outlook 5
W Create a Quick Step or VBA to SAVE AS PDF in G:|Data|Client File Outlook VBA and Custom Forms 1
W September 2020 - No Default Email Client message after Office Update Using Outlook 1
J Outlook 2010 Outlook/Win7 Client logging Event ID 36887 Using Outlook 0
L Outlook Office 365 client: won't remember my setting File, not to collapse ribbon Using Outlook 2
P Outlook 2016 Client and 365 - Groups Folder Using Outlook 3
G How to have domain client use owa server instead of exchange server while connect to network Using Outlook 1
I Outlook 2013 Rules - (client only) Using Outlook.com accounts in Outlook 1
F "Move to" O365 feature to Outlook client via VBA Outlook VBA and Custom Forms 4
P Outlook 2016 Not Default Client Using Outlook 5
A How to get rid of "sending on behalf of" when sending from Outlook 2016 client Using Outlook 12
R Outlook 2016 - How to change password in MS Exchange email client Using Outlook 0
R Making Outlook default client in share charm Using Outlook 4
L Synching Office 365 contacts to Iphone MS Outlook client Using Outlook 5
T Client-side rules not working, but no error Using Outlook 1
P What Are Alternatives for New Email Client After Office365 Using Outlook 8
J Install BCM Client without an local SQl Database BCM (Business Contact Manager) 6
B Exchange 2010 / Outlook 20070 "client error in synchronization log" Exchange Server Administration 1
T Calendar Entry in Outlook Client but will not sync Exchange Server Administration 1
T client addin deletes all business contacts BCM (Business Contact Manager) 1
R Can BCM monitor and select specific emails and use content info to update the client's record? BCM (Business Contact Manager) 1
P Outlook 2013 client not showing newly added Contacts but... Using Outlook 5
Z Outlook 2010 client to Exchange ,,,,search not working proparly Exchange Server Administration 0
J Outlook client not redrawing completely upon restore Using Outlook 0
T Sent Items Rule and Client Only Using Outlook 5
C Either there is no default mail client or the current mail client cannot ... Using Outlook 1
R Ingest contact PST from exchange 2007 thru client's Outlook via PRF Exchange Server Administration 2
M Outlook client macro to web access Using Outlook 1
T Make Default Outlook 2010 Client Mail Using Outlook 1
J “additional” mailbox cannot be removed from an Outlook 2007 client’s mailbox Exchange Server Administration 1

Similar threads

Back
Top