Can AdvancedSearch do multiple header fields?

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?
 
S

Sue Mosher [MVP-Outlook]

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.
 
Z

zofficedepot

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top