AdvancedSearch filter: cannot search "to" by smtpaddress?

S

sysong

I am trying to search for all emails sent to a specific email address. These
emails may reside in Personal Folders, so I cannot use WebDav. When using the
AdvancedSearch method, I discovered that the following filters do not work:

"urn:schemas:httpmail:to" LIKE '%[email protected]%'"
"urn:schemas:mailheader:to" LIKE '%[email protected]%'"
"urn:schemas:httpmail:displayto" LIKE '%[email protected]%'"
"urn:schemas:httpmail:cc" LIKE '%[email protected]%'"

If I use the Display Name, then I do get results.

"urn:schemas:httpmail:to" LIKE '%John Doe%'"

However, "Display Name" is largely useless.
Strangely, if I were to use WebDav and perform a similiar search on emails
in my Exchange mailbox, I do get results:

"WHERE \"urn:schemas:httpmail:to\" LIKE '%[email protected]%' "

So, is it correct to assume that one cannot search the email "to" field
using an smtp address with the AdvancedSearch method? I find it odd that
- searches using "Display Name" work. I would think that Display Name is
universally useless.
- searches by WebDav do work. I was hoping that if the functionality was
available in one, it would also be available in the other.
 
S

Sue Mosher [MVP-Outlook]

Yes, that's correct, at least based on my testing on this issue. I suspect that it has to do with the fact that a message may have multiple recipients. Looking at a search folder with MFCMAPI or Outlook Spy is instructive in this area; the search rules that it uses for a "Send To = (e-mail address removed)" type search are quite complex.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

sysong

Thanks for the response Sue. I had guessed that it was not possible, but I am
glad to get a qualified source to confirm it!
 

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