AdvancedSearch and recipients email address

D

DaveSam

Using the AdvancedSearch object, I cannot find a way to search for a
string in the recipients email address. I have used
urn:schemas:httpmail:displayto, but this is only the Display name, not
necessarily the email address.

When I try to use urn:schemas:httpmail:to or urn:schemas:mailheader:to,
no matter what I put in the search string, no results are returned.

I have done this both in Outlook 2003 VBA and in VS 2003 c#. Both
result in the exact same behavior.

The scenario is:

Allow the user to input any part of an email address and be able to
find emails that were sent to anyone with that string in their address.
Displayname works if the email address is part of the DisplayName
field, however this is not always the case.

I also tried using Restrict, but without the ability to use wildcards
or Contains, it won't work for them.

Any help greatly appreciated.

Thanks,

Dave
 
D

DaveSam

Thanks for the effort, Ken, but I did mention why that won't work in
the first paragraph of my post.

If you have information about using "displayto" in some fashion that
will give me the users email address instead of their display name, I
am all ears.

Thanks anyway.
Dave
 
D

DaveSam

Sue,

I thought I saw another post from you referencing that tag, but in
reference to the Senders email address. And from my experimenting, I
think that it is the senders email, not the recipients.

I took your info, though, and using DC ExchangeInspector, started
poking around. No luck, yet, though there is a tag, 0x1042001E, that
looks promising, but only if the person isn't a contact - at least that
is how it appears in my early testing.

Perhaps Outlook, when using the Advanced Find feature, uses the built
in contact information if the recipient is in one of the contacts
folders???

If you have any additional info, I would appreciate it - this is
starting to get to me :)

Thanks,

Dave
 
S

Sue Mosher [MVP-Outlook]

You're right -- it is the sender's address. Somehow I'd missed that you were trying to search for the recipient's address. Can you refresh my memory, since it's not quoted below, on what you're trying to do?

Based on what I can see with MFCMAPI, Advanced Find and search folders search the Recipients table on each message using the MAPI property PR_EMAIL_ADDRESS (0x3003001E) as well as the display name. In other words, they're doing a "SubObject" search, rather than searching properties you can invoke directly in a DASL query.
 
D

DaveSam

Sure, Sue - here's the original text:
-----------------------
Using the AdvancedSearch object, I cannot find a way to search for a
string in the recipients email address. I have used
urn:schemas:httpmail:displayto­, but this is only the Display name,
not
necessarily the email address.


When I try to use urn:schemas:httpmail:to or urn:schemas:mailheader:to,

no matter what I put in the search string, no results are returned.


I have done this both in Outlook 2003 VBA and in VS 2003 c#. Both
result in the exact same behavior.


The scenario is:


Allow the user to input any part of an email address and be able to
find emails that were sent to anyone with that string in their address.

Displayname works if the email address is part of the DisplayName
field, however this is not always the case.


I also tried using Restrict, but without the ability to use wildcards
or Contains, it won't work for them.

---------------------

So, any ideas on how to accomplish a "subobject" search? I haven't had
a chance to start thinking about it yet, but a shove in the right
direction would be appreciated!

I am using c# to build the project and have it almost finished. The
results of the search are sorted and then pushed to a Word document in
table format for easy reading and printing.

Thanks again,

Dave.
 

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