3

I am searching a list of mails from their respective PR_MESSAGE_ID using the Outlook VSTO AdvancedSearch feature.

My query looks like

 http://schemas.microsoft.com/mapi/proptag/0x1035001E = 'targetId1' OR
 http://schemas.microsoft.com/mapi/proptag/0x1035001E = 'targetId2' OR
 http://schemas.microsoft.com/mapi/proptag/0x1035001E = 'targetId3' OR 
 http://schemas.microsoft.com/mapi/proptag/0x1035001E = 'targgetId4' ...etc.

I am questioning the performance of this approach and I would like to know if there is a more elegant query, similar to a SELECT something WHERE 'MESSAGE_ID' IN (targetId1, targetId2, etc.)

Benoit Patra
  • 4,355
  • 5
  • 30
  • 53

1 Answers1

0

No, AdvancedSearch is a right choise because the search is performed in the background not blocking the UI thread. Moreover, you can search for items in multiple forlders.

All DASL queries begin with a case-sensitive prefix "@SQL=", with the exception of DASL queries for Application.AdvancedSearch.

See Filtering Items for other alternatives.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45