Finding messages by conversation macro

N

Nagua

I am familiar with some VBA macro writing in Word but no nothing for how to
do this in Outlook. I am trying to accomplish the following:

Find all email messages, by conversation, after I reply to a message with a
certain phrase and move it to Folder named Completed Work.

I attempted to run a rule, but I need to run a script within the rule to
complete the "find messages by conversation" part.

Can this be accomplished and how?

Thanks!
 
K

Ken Slovak - [MVP - Outlook]

You would use a Find or Restrict on the Items collection of each folder
where you wanted to find those related items. The property to filter on is
the ConversationTopic property.

How you get a folder reference for something like Completed Work depends on
where it's located in the folder tree. Let's say the filter is just for
Inbox, code would look something like this:

Sub GetConversationItems(Item As MailItem)
Dim oFolder As Outlook.MAPIFolder
Dim colItems As Outlook.Items
Dim colFiltered As Outlook.Items

Set oFolder = Application.Session.GetDefaultFolder(olFolderInbox)
Set colItems = oFolder.Items
Set colFiltered = colItems.Restrict("[ConversationTopic]='" &
Item.ConversationTopic & "'")

' now you have the items in that conversation, do something with them
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