MS Office Forum / Outlook / Programming VBA / June 2005
AdvancedSearch and recipients email address
|
|
Thread rating:  |
DaveSam - 27 Jun 2005 19:07 GMT 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
Ken Slovak - [MVP - Outlook] - 28 Jun 2005 14:39 GMT Try using this:
urn:schemas:httpmail:displayto
 Signature Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm
> Using the AdvancedSearch object, I cannot find a way to search for a > string in the recipients email address. I have used [quoted text clipped - 22 lines] > > Dave DaveSam - 28 Jun 2005 14:55 GMT 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
Sue Mosher [MVP-Outlook] - 28 Jun 2005 22:23 GMT Try using http://schemas.microsoft.com/mapi/proptag/0x0065001f to search based on address.
 Signature Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx
> Using the AdvancedSearch object, I cannot find a way to search for a > string in the recipients email address. he I have used [quoted text clipped - 22 lines] > > Dave DaveSam - 30 Jun 2005 02:35 GMT 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
Sue Mosher [MVP-Outlook] - 30 Jun 2005 03:03 GMT 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.
 Signature Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx
> Sue, > [quoted text clipped - 17 lines] > > Dave DaveSam - 30 Jun 2005 11:04 GMT 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.
|
|
|