P
Patrick Pirtle
I've written an app that redirects incoming emails to
different folders based upon categories assigned in
my contacts. I use the lines:
strAddress = oSafeMail.Sender.Address
For i = 1 To 3
strFind = "[Email" & i & "Address] = """ & strAddress & """ and
[FileAs] <> ""Group"""
Set oContact = allContacts.Find(strFind)
to loop through my contacts looking for the sender.
My problem is that, on occasion, this fails to find the
person in my contacts even though they're in there.
When I start trying to debug the problem, I start
getting confused as to just what is being compared.
For example, I might have a contact with:
Email... = (e-mail address removed)"
Display as: "Susan M.Johnson P.E. ([email protected])"
I receive an email from her, and it displays in my inbox
as being from "Susan M. Johnson". If I open the email,
the From field contains "Susan M. Johnson". If I
try to look at the header through the View\Options menu,
it doesn't show any header at all, as this came through
the Exchange Server.
The search string my app builds looks like:
"[Email1Address] = "/O=COMPANY/OU=FIRST ADMINISTRATIVE
GROUP/CN=RECIPIENTS/CN=SMJ" and [FileAs] <> "Group""
I assume the "SMJ" above is because her email is
actually stored as (e-mail address removed) and Exchange
has "Susan M. Johnson" as some kind of alias.(?)
My app correctly moves this one to the correct folder.
Now, I have another contact with:
Email... = "(e-mail address removed)"
Display as: "(e-mail address removed)"
I receive an email from him, and it displays in my inbox
as being from "Rick Jones". If I open the email email, the
From field contains "Rick Jones [[email protected]]".
If I look at the header through the View\Options menu,
it shows it to be from "Rick Jones <[email protected]>".
The search string my app builds looks like:
"[Email1Address] = (e-mail address removed) and [FileAs] <> "Group""
My app correctly moves this one to the correct folder.
And finally, I have a contact with:
Email... = "(e-mail address removed)"
Display as: "Paul A Smith P.E. ([email protected])"
I receive an email from him VIA BLACKBERRY, and it
displays in my inbox as being from "Paul Smith". If I open
the email, the From field contains "Paul Smith [[email protected]]".
If I try to look at the header through the View\Options menu,
it shows it to be from:
"=?utf-8?B?QnJhZCBDYW1lcm9u?=" <[email protected]>"
The search string it is building looks like:
"[Email1Address] = (e-mail address removed) and [FileAs] <> "Group""
My app FAILS to find this person in my contacts.
I've tried modifying my contact's "Email...", "Display as:",
etc. every which way I could, but can't quite figure out what
is really being compared. Is there a better way to search
for these? TIA for any help and suggestions.
____________________________________________
The impossible just takes a little longer...
different folders based upon categories assigned in
my contacts. I use the lines:
strAddress = oSafeMail.Sender.Address
For i = 1 To 3
strFind = "[Email" & i & "Address] = """ & strAddress & """ and
[FileAs] <> ""Group"""
Set oContact = allContacts.Find(strFind)
to loop through my contacts looking for the sender.
My problem is that, on occasion, this fails to find the
person in my contacts even though they're in there.
When I start trying to debug the problem, I start
getting confused as to just what is being compared.
For example, I might have a contact with:
Email... = (e-mail address removed)"
Display as: "Susan M.Johnson P.E. ([email protected])"
I receive an email from her, and it displays in my inbox
as being from "Susan M. Johnson". If I open the email,
the From field contains "Susan M. Johnson". If I
try to look at the header through the View\Options menu,
it doesn't show any header at all, as this came through
the Exchange Server.
The search string my app builds looks like:
"[Email1Address] = "/O=COMPANY/OU=FIRST ADMINISTRATIVE
GROUP/CN=RECIPIENTS/CN=SMJ" and [FileAs] <> "Group""
I assume the "SMJ" above is because her email is
actually stored as (e-mail address removed) and Exchange
has "Susan M. Johnson" as some kind of alias.(?)
My app correctly moves this one to the correct folder.
Now, I have another contact with:
Email... = "(e-mail address removed)"
Display as: "(e-mail address removed)"
I receive an email from him, and it displays in my inbox
as being from "Rick Jones". If I open the email email, the
From field contains "Rick Jones [[email protected]]".
If I look at the header through the View\Options menu,
it shows it to be from "Rick Jones <[email protected]>".
The search string my app builds looks like:
"[Email1Address] = (e-mail address removed) and [FileAs] <> "Group""
My app correctly moves this one to the correct folder.
And finally, I have a contact with:
Email... = "(e-mail address removed)"
Display as: "Paul A Smith P.E. ([email protected])"
I receive an email from him VIA BLACKBERRY, and it
displays in my inbox as being from "Paul Smith". If I open
the email, the From field contains "Paul Smith [[email protected]]".
If I try to look at the header through the View\Options menu,
it shows it to be from:
"=?utf-8?B?QnJhZCBDYW1lcm9u?=" <[email protected]>"
The search string it is building looks like:
"[Email1Address] = (e-mail address removed) and [FileAs] <> "Group""
My app FAILS to find this person in my contacts.
I've tried modifying my contact's "Email...", "Display as:",
etc. every which way I could, but can't quite figure out what
is really being compared. Is there a better way to search
for these? TIA for any help and suggestions.
____________________________________________
The impossible just takes a little longer...