A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Finding messages by conversation macro



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 18th 09, 07:36 PM posted to microsoft.public.outlook.program_vba
Nagua
external usenet poster
 
Posts: 2
Default Finding messages by conversation macro

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!



Ads
  #2  
Old August 18th 09, 07:51 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Finding messages by conversation macro

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

--
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


"Nagua" wrote in message
...
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!




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Messages Per Conversation [email protected] Outlook and VBA 1 January 16th 08 03:45 PM
Finding Forwarded Messages Peter Outlook - General Queries 1 May 2nd 07 01:36 PM
Macro to clear the old conversation mrbalaje Outlook and VBA 0 January 1st 07 05:44 AM
Group messages by conversation, missing in Outlook? Trond Svendsen Outlook - General Queries 3 November 7th 06 02:08 PM
Advanced views.."By Conversation". Is it possible to have a view where I see only the first Item of a conversation? [email protected] Outlook - General Queries 2 February 1st 06 09:41 PM


All times are GMT +1. The time now is 08:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.