Can't modify PR_CLIENT_SUBMIT_TIME?

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
 
D

Dmitry Streblechenko

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.
Thread starter Similar threads Forum Replies Date
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
B Outlook 2007, must modify incomming e-mail addresses to reply Using Outlook 3
A Auto modify an email used in 'Server reply using'. Using Outlook 1
C modify user password programmatically Exchange Server Administration 9
H Use group policy to block access to modify account settings outlook/exchange 2010. Using Outlook 1
P Will 'ldap modify' command work on some Active Directory fields? Using Outlook 2
U How modify attachment in an email Using Outlook 5
S Unable to create or modify mailboxes in Exchange 2010 after modifying AD with ADSIEDIT Exchange Server Administration 4
W How can I modify an email address when I reply to it? [Outlook 2003] Using Outlook 3
L not able to access signatures to modify, add, or edit. Using Outlook 1
C unable to modify tags for categories in outlook 2010 Using Outlook 1
T Is there a way to bulk modify the alias field in a Exchange 2010 enviornment? Exchange Server Administration 2
K Adminstrator unable to modify any of the settings in Exchange 2010 - insufficient access rights Exchange Server Administration 4
J Rights to modify all distribution lists Exchange Server Administration 3
S I noticed most of my rules are not able to be edited or deleted - the option to do so are 'faded' out. A few rules are OK to modify etc. See Using Outlook 3
A Changed the 'Modify Configuration DOmain Controller' on Exchange 2010 casnhub server Exchange Server Administration 2
A Changed the 'Modify Configuration DOmain Controller' on Exchange 2010 casnhub server Exchange Server Administration 5
B Error while creating/saving a new appointment in Outlook web access 2003 'You don't have permission to modify this item'. Using Outlook 1
Z Unable to configure an IPv4 address because IPv4 is not available.Attempt to modify the IP addresses Exchange Server Administration 4
S Unable to Modify Signatures Using Outlook 1
P Is there a way to modify my shared Outlook calendar via my mobile phone Using Outlook 3
G Check Names function not working properly on 11 of 45 computers. Need to know how to modify the settings for this property. Using Outlook 4
B Modify text after sign in failure Exchange Server Administration 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
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
Similar threads


















































Top