2

Is it possible to filter mails in outlook using ConversationID?

This is what I have tried (filtering on subject) :

        Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();
        Microsoft.Office.Interop.Outlook.MAPIFolder oInbox = Globals.ThisAddIn.Application.Session.Folders["abc@gmail.com"].Folders["Inbox"];
        string sFolderPath = oInbox.FolderPath;
        string sScope = "SCOPE ('deep traversal of \"" + sFolderPath + "\"')";
        string sFilter = "\"urn:schemas:mailheader:subject\" LIKE '%search%'";
        oApp.AdvancedSearchComplete += new ApplicationEvents_11_AdvancedSearchCompleteEventHandler(oApp_AdvancedSearchComplete);
        Microsoft.Office.Interop.Outlook.Search oSearch = oApp.AdvancedSearch(sScope, sFilter, false, "Search results" + DateTime.Now.ToString());
        Microsoft.Office.Interop.Outlook.MAPIFolder oSearchFolder = oSearch.Save("Search results" + DateTime.Now.ToString());

I have already checked Display email in Outlook by using ConversationID. It says to search using entryId but I need conversationId.

Any help is appreciated.

Thanks in advance.

Community
  • 1
  • 1
vicky99
  • 49
  • 9
  • `ConversationID only works in local to track emails in the same email chain` – MethodMan Nov 17 '14 at 14:53
  • Do a google search on the following and look at examples that are given as well `C# Filter mails using ConversationID` – MethodMan Nov 17 '14 at 15:05
  • Hi @DJKRAZE, I did a lot of Google search on this but did not find any proper solution. Can you give me some pointers ? Already read these articles : http://blogs.msdn.com/b/andrewdelin/archive/2005/05/11/416312.aspx http://blogs.msdn.com/b/andrewdelin/archive/2005/08/08/448882.aspx – vicky99 Nov 17 '14 at 15:29
  • I just did did you enter into Google the following `C# Filter mails using ConversationID` – MethodMan Nov 17 '14 at 15:31
  • Yes, First link points to this question itself. Second one is related to issue but not to my question. After that links are not much relevant – vicky99 Nov 17 '14 at 15:34
  • Hey @vicky99 have you got any solution for above search? – Aniket Bhansali Nov 14 '16 at 07:33
  • @AniketBhansali - There is no quick and direct solution available. I ended up looping on all the items. One improvement you can do is first filter on some other field like "mail sent date". – vicky99 Dec 05 '16 at 05:24

0 Answers0