Discussion:
Change category of original message upon reply
(too old to reply)
OutdoorRuss
2010-10-11 19:45:46 UTC
Permalink
I am looking for a way to change the category of the original message
once I have replied to it. For instance, I have two categories,
"Reply Needed" and "Waiting for Reply". When a message comes in, it
automatically gets the "Needs Reply" via a rule. When I reply to it,
I want the original message to automatically switch to "Waiting For
Reply" so I don't have to remember to re-categorize it. How is this
possible??
Ken Slovak
2010-10-11 20:35:21 UTC
Permalink
You would need to write code that either on reply or send changed the
category.

If it was on the Reply event on the original item you'd need to handle all
items as they are being opened, and to also handle all items as the
Explorer.Selection collection changes. You will need to set up Reply event
handlers for all those items and add/remove them as items are opened and
closed and you change the selection.

That would work for all replies except where you reply and then cancel
rather than send.

If you handle send on all items that are opened you can grab the
ConversationIndex and ConversationTopic properties from the outgoing item
(need to save it first in the Send event). You can then find items in Inbox
with the same ConversationTopic and 1 fewer time/stamp in the
ConversationIndex property.

ConversationIndex is set to a time/date stamp on the first member of a
conversation and then a new stamp is added for each new member of the
conversation. That would allow you to find the original of a reply and to
then change its category.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by OutdoorRuss
I am looking for a way to change the category of the original message
once I have replied to it. For instance, I have two categories,
"Reply Needed" and "Waiting for Reply". When a message comes in, it
automatically gets the "Needs Reply" via a rule. When I reply to it,
I want the original message to automatically switch to "Waiting For
Reply" so I don't have to remember to re-categorize it. How is this
possible??
OutdoorRuss
2010-10-12 04:07:26 UTC
Permalink
Any chance you might be willing to provide some code to get me
started?? Thanks Ken!
Ken Slovak
2010-10-14 13:57:07 UTC
Permalink
I don't have any specific code for that, but here's a link to an article
with more technical information about ConversationTopic/ConversationIndex:
http://www.devnewsgroups.net/officedev/t17672-conversationtopic-question.aspx

The following links discuss handling forward/reply/replyall:
http://www.outlookcode.com/threads.aspx?forumid=5&messageid=9383 and send:
http://www.outlookcode.com/threads.aspx?forumid=2&messageid=4153

That should help to get you started.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by OutdoorRuss
Any chance you might be willing to provide some code to get me
started?? Thanks Ken!
OutdoorRuss
2010-10-18 21:45:20 UTC
Permalink
Here's what I ended up with... seems to work great for me. - Russ


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)

'Declaration
Dim myItems, myItem, myAttachments, myAttachment As Object
Dim myOrt As String
Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection
Dim Response As String

On Error Resume Next

'work on selected items
Set myOlExp = myOlApp.ActiveExplorer
Set myOlSel = myOlExp.Selection

'for all items do...
For Each myItem In myOlSel

With myItem

If Not myItem Is Nothing Then
Response = MsgBox("Do you want to mark this message Waiting
For Reply?", vbYesNoCancel, "Category?") = vbYes

If Response = True Then
.Categories = "Waiting For Reply"
.FlagRequest = "Waiting"
.Save
End If
If Response = False Then
.Categories = "Complete"
.ReminderSet = False
.TaskCompletedDate = Date
.Save

End If
End If

End With

myItem.Save


Next

'free variables
Set myItems = Nothing
Set myItem = Nothing
Set myOlApp = Nothing
Set myOlExp = Nothing
Set myOlSel = Nothing

End Sub

Loading...