Can AdvancedSearch do multiple header fields?

  • Thread starter Thread starter zofficedepot
  • Start date Start date
Z

zofficedepot

Can AdvancedSearch do multiple header fields in .Filter, such as
strF = Chr(34) & "urn:schemas:httpmail:subject" & Chr(34) & " like
'%questions%'"
strF = strF & Chr(34) & "AND urn:schemas:httpmail:from" & Chr(34) &
" like '%ob%'"
(to get Bob or Robert there) or are you restricted to one field?
If you are restricted, then can Search.Save append multiple search
results?
 
Yes, you can have multiple expressions in a single query string. Note that yours below needs to move a quotation mark to surround the property tag:

strF = strF & " AND " & Chr(34) & urn:schemas:httpmail:from" & Chr(34) & " like '%ob%'"

You would have seen that, of course, if you using a Debug.Print to view the search string.

Search.Save does not append.
 
Yes, you can have multiple expressions in a single query string. Note that yours below needs to move a quotation mark to surround the property tag:

strF = strF & " AND " & Chr(34) & urn:schemas:httpmail:from" & Chr(34) & " like '%ob%'"

You would have seen that, of course, if you using a Debug.Print to view the search string.

Search.Save does not append.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54

Excellent response. Just excellent.
 
Back
Top