ADSL - filter by email address to

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

I'm having a problem filtering the sent items folder by
"urn:schemas:httpmail:to" LIKE '%emailaddress%' ... the search always
returns nothing. Same is true for "urn:schemas:mailheader:to" LIKE
'%emailaddress%'. I would use the displayto property but it is specific to
how an individual chooses to display a mail address unlike the email
address.

Any help in obtaining a filter to provide a list of emails sent to an
individual by email address would be appreciated.

Thanks
 
M

Michael Bauer [MVP - Outlook]

Have your tried this:

urn:schemas:httpmail:displayto" LIKE '%emailaddress%'

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Mon, 2 Nov 2009 16:00:08 -0600 schrieb news.microsoft.com:
 
R

Randall

Yes. As I mentioned in my note this only looks at the display name which
can be anything and is not related to the actual email address.

What I am looking to do is this. Given an email address find all
correspondences to this email address.

Thanks
 
S

Sue Mosher [MVP]

Just using the built-in view Filter dialog and its SQL tab, I came up with
this in Outlook 2007:

("http://schemas.microsoft.com/mapi/proptag/0x0e04001f" CI_STARTSWITH
'@gmail.com' OR "http://schemas.microsoft.com/mapi/proptag/0x0e03001f"
CI_STARTSWITH '@gmail.com')

Odd that it would be CI_STARTSWITH instead of CI_PHRASEMATCH, but that's
what the SQL tab had. And the view showed all the gmail addresses,
regardless of whether that string was in the display name.

Then I modified it to use LIKE in case it's an earlier version or unindexed,
but that returned only those items that had @gmail.com in the display name.

("http://schemas.microsoft.com/mapi/proptag/0x0e04001f" LIKE
'%@gmail.com%' OR "http://schemas.microsoft.com/mapi/proptag/0x0e03001f"
LIKE '%@gmail.com%')

These results make me wonder if the underlying email address is available
only for an indexed search.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
R

Randall

Thanks for the info Sue ... but when I am performing the same search it
appears to only be returning messages with the specified email address in
the to or cc fields ... and not returning those for the same email address
that only displayed a name.

Was hoping that was the answer as I was unaware that the sql was written for
searches where the sql is not explicitly provided.

One other question. Is this information, being able to filter folders, only
available where exhange is the mail sever?

Thanks in advance.
 
S

Sue Mosher [MVP]

When it comes to viewing and manipulating data, Outlook generally doesn't
care what data store is involved.

Did you ever tell us your Outlook version? Which of my two search strings
did you try?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
R

Randall

Good to see it is not dependent on the datastore.

I used the filter view in Outlook 2007, that I now know how to use, and used
the To field on the messages tab. The SQL for the query is the same as
yours and returns all mail with emailaddress in the To field and also
returns some messages (a very small fraction) of messages where the name
associated with the email address is displayed in the To field.

("http://schemas.microsoft.com/mapi/proptag/0x0e04001f" CI_STARTSWITH
'emailaddress' OR "http://schemas.microsoft.com/mapi/proptag/0x0e03001f"
CI_STARTSWITH 'emailaddress')

This returns only mail with the emailaddress in the To field
("http://schemas.microsoft.com/mapi/proptag/0x0e04001f" LIKE
'%emailaddress%' OR "http://schemas.microsoft.com/mapi/proptag/0x0e03001f"
LIKE '%emailaddress%')

I would have thought that since the email addresses are in the header of the
message that "urn:schemas:mailheader:to" would contain the string of
recipients but this comes back with no results.

I'm not sure what all is available .... but if there are alternate methods
of obtaining this list of recipients in code I would be willing to look at
doing that. Any thoughts would be appreciated.

Thanks
 
S

Sue Mosher [MVP]

Those are essentially the same results I reported, except that as far as I
could tell, with the first query, I got all messages sent to the gmail.com
domain, not just some, regardless of whether that string was in the display
name. I can't duplicate your "very small fraction" result.

Messages in your own Sent Items folder won't have any Internet headers. You
should be able to see that with Outlook Spy or MFCMAPI.exe.

The alternative is to iterate the Recipients collection for each item and
examine each Recipient.Address.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
D

Dmitry Streblechenko

<plug>
Redemption remaps To/CC/BCC properties specified i a query to look at the
actuall recipeint name and address instead of just PR_DISPLAY_xyz proeprty
on the message.

set Table = CreateObject("Redemption.MAPITable")
Table.Item = Application.ActiveExplorer.CurrentFolder.Items
set Recordset = Table.ExecSQL("SELECT Subject, EntryID from Folder " & _
"where (To = '(e-mail address removed)' ) " & _
"order by LastModificationTime desc")
while not Recordset.EOF
Debug.Print(Recordset.Fields("Subject").Value & " - " &
Recordset.Fields("EntryID").Value)
Recordset.MoveNext
wend

</plug>

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 

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