Sender and recipient criteria in AdvancedSearch not working

M

msielski

I have tested this in VBA and in VB.NET and can not get it to work. I
am using AdvancedSearch and would like to specify a criteria based on
the sender's email address and the recipient's email address (not
necessarily at the same time, and not their display names but their
actual email addresses) . I have tried the fields:

urn:schemas:httpmail:to
urn:schemas:httpmail:sender
urn:schemas:httpmail:fromemail
urn:schemas:httpmail:toemail
urn:schemas:mailheader:to
urn:schemas:mailheader:sender
urn:schemas:mailheader:fromemail
urn:schemas:mailheader:toemail
urn:schemas:mailheader:mailheader-from


I get no search results using any of these fields. Some of these are
from MSDN's documentation, others were suggested by people in Usenet.
I have found another post from over a year ago with the similar
problem, but saw no resolution.

Can this be done?

Thank you for any help.

- Matt
 
S

Sue Mosher [MVP-Outlook]

For the sender's address, use http://schemas.microsoft.com/mapi/proptag/0x0065001f (easily found by using the Filter dialog for an Outlook view and checking the SQL tab.

I've never found any analogous property for the recipient address, probably because there can be 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.

urn:schemas:httpmail:displayto and urn:schemas:httpmail:displaycc will get you the display names, though.

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

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

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