unset "replied" status of a message

W

Wilfried

Hello,
I chose "reply" to a message but then did not send the reply and deleted
it instead.
The original (received) message is still displayed as "replied to".
How can I un-set the replied-to status of the original message?
 
K

Ken Slovak

You can't if you are using the Outlook object model.

That status is calculated from the MAPI property PR_LAST_VERB_EXECUTED
(0x10810003), which in the case of a reply would be 102
(EXCHIVERB_REPLYTOSENDER).

It's not even exposed in the Outlook object model, and the PropertyAccessor
can't change the value.

You would have to use a lower level API such as Extended MAPI (unmanaged C++
or Delphi only) or something like Redemption (www.dimastr.com/redemption) to
change that property value.
 
W

Wilfried

You can't if you are using the Outlook object model.

That status is calculated from the MAPI property PR_LAST_VERB_EXECUTED
(0x10810003), which in the case of a reply would be 102
(EXCHIVERB_REPLYTOSENDER).
...

You would have to use a lower level API such as Extended MAPI (unmanaged C++
or Delphi only) or something like Redemption (www.dimastr.com/redemption) to
change that property value.

Thank you for the reply.
I already thought of redemption and downloaded it, but I gave up because
I only found examples in which a property is retrieved (e.g. your post
at
http://www.eggheadcafe.com/software...ieve-replyforward-flag-status--timestamp.aspx
)
I also found and modified an example how to use redemption, but I do not
understand how to change the "replied" property.
In some postings it is said that this property isn't present if the
message was never replied to - would that mean that I have to delete
this property to make the message "unreplied"?

My first attempt (yet incomplete):

Public Sub Make_Unreplied()
Dim Mail As Redemption.rdoMail
Dim Session As Redemption.RDOSession
Const PR_LAST_VERB_EXECUTED = &H10810003

Set Session = CreateObject("redemption.rdoSession")
Session.MapiObject = Application.Session.MapiObject

' assumed that a received message is selected
With Application.ActiveExplorer.Selection(1)
Set Mail = Session.GetMessageFromID(.EntryID, .Parent.StoreID)
' next line should modify the status, but how?
??? Set Mail.Fields(PR_LAST_VERB_EXECUTED) = <???>
End With
' Is it necessary to save the MapiObject after modifying it?
End Sub

Regards
 
K

Ken Slovak

To delete a property using Redemption you would set the Field you are
interested in to Empty. If it's a named property that gets added only if
there's a value to it that deletes the property.
 
W

Wilfried

Ken Slovak said:
To delete a property using Redemption you would set the Field you are
interested in to Empty. If it's a named property that gets added only if
there's a value to it that deletes the property.

For the records (and for anyone else who searches for it),
here is the finally working code (Outlook 2003 + Redemption):

Sub Make_Unreplied()
Dim Session As Object
Dim Mail As Object
Dim Utils As Object
Const PR_LAST_VERB_EXECUTED = &H10810003
Const PR_LAST_VERB_EXECUTION_TIME = &H10820040
Const PrIconIndex = &H10800003

Set Session = CreateObject("Redemption.rdoSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT

' assumed that a received message is selected
With Application.ActiveExplorer.Selection(1)
Set Mail = Session.GetMessageFromID(.EntryID, .Parent.StoreID)
Set Utils = CreateObject("Redemption.MAPIUtils")
Mail.Fields(PR_LAST_VERB_EXECUTED) = 0
Mail.Fields(PR_LAST_VERB_EXECUTION_TIME) = #1/1/100#
Utils.HrSetOneProp Mail, PrIconIndex, 256, True
Mail.Save
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top