title: excluding emails with certain subject from email inbox search with EWS
body: <p>I am using EWS to upgrade an application that used WebDAV to query an Exchange Server 2003 mailbox, the new version will work with Exchange Server 2010 SP2.</p>
  
  <p>I want to exclude email items that have a subject that includes these search terms:
  "FATS;Assignment;Sandbox: Assignment"</p>
  
  <p>I looked at <a href="http://msdn.microsoft.com/en-us/library/office/dd633693%28v=exchg.80%29.aspx" rel="nofollow noreferrer">MSDN Library: Searching for items in a mailbox by using the EWS Managed API</a> and found out how to filter the recipients, and that the emails have attachments, but now I need to go a step further and only read emails that don't have the subjects above (4 different string exclusions)</p>
  
  <p>here is the code I tried:</p>
  
  <pre><code>searchFilterCollection.Add(new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false)));
  searchFilterCollection.Add(new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.HasAttachments, true)));
  searchFilterCollection.Add(new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.ContainsSubstring(EmailMessageSchema.Subject, "FATS;Assignment;Sandbox: Assignment")));
  </code></pre>
  
  <p>but I know (the last item) will only find items that contain those terms, how can I exclude those terms using a SearchFilter please?</p>