title: C# Interop.Outlook find messages with specific word in subject
body: <p>I have an application that needs to look for a given word in the subject of emails in the inbox.  My code looks like this:</p>
  
  <pre><code> outlook = new OL.Application();
          outlookNameSpace = outlook.GetNamespace("mapi");
  
          outlookNameSpace.Logon(Type.Missing, Type.Missing, false, true);
  
          inbox = outlookNameSpace.GetDefaultFolder(OL.OlDefaultFolders.olFolderInbox);
          inboxItems = inbox.Items;
  
  
          string filter = "@SQL =\"http://schemas.microsoft.com/mapi/proptag/0x0037001f\" LIKE 'Michigan'";
          OL.Search advancedSearch = outlook.AdvancedSearch("'inbox'", filter);
  </code></pre>
  
  <p>When I execute the last statement (advancedSearch = ....), I get the following error message.</p>
  
  <p>An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred </p>
  
  <p>Additional information: The operation failed.</p>
  
  <p>I am new to Advanced Search and DASL queries in general, so my error may be very basic.</p>
  
  <p>I can loop through inboxItems to find the relevant items, but that is rather slow on an a large inbox (6700 items in my case)</p>