IAddrBook::ResolveName() problems

S

Sergeichik

1. If there are two similar contacts with names: "NN" and "NN " in Outlook
address book (second name with gap after letters), and I call ResolveName()
with parameter PR_DISPLAY_NAME = "NN", function can't resolve names and show
dialog (if MAPI_DIALOG flag was set). Function must find the contact without
the dialog been shown, as 'NN' and 'NN ' (with gap after) are really distinct
names.
2. If there are two contacts, one of which is substring of another: for
example, "Jane" and "Jane L" and function ResolveName() was called to find
"Jane", it can't resolve names too (see 1). Function must find the contact
without the dialog been shown, as 'Jane' and 'Jane L' are really distinct
names.
3. If there are two contacts with coincident names, but in diffrent folders,
ResolveName() stopped at the first founded contact. But dialog 'select name'
should be appear.
4. If display name looks like e-mail: for example, (e-mail address removed), ResolveName()
can't find contact at all.

How can I handle this particularities ?
 
D

Dmitry Streblechenko

1. If you get an ambiguous name, you can perform a PR_ANR restriction on an
AB container (such as GAL) that you are interested in.
2. Must? That is not how it worked for the last 15 years or so.
3. That is just how name resolution is implemeted. MAPI loops through all AB
providers in the search path (remember you can have multiple independent
providers) and stops at the very first one that returns success or an
ambiguous name. In case of an ambiguous name, it performs PR_ANR restriciton
on that container and uses the returned entries to display the "Ambiguous
name" dialog.
4. Can't find as in "returns an error"? Or as in "returns a one-off entry"?
Which AB provider is that? Remember that MAPI itself does not resolve a
name, a particular address book provider does. and each one of them can have
a different implementation.

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

Sergeichik

3. That is just how name resolution is implemeted. MAPI loops through all AB
providers in the search path (remember you can have multiple independent
providers) and stops at the very first one that returns success or an
ambiguous name. In case of an ambiguous name, it performs PR_ANR restriciton
on that container and uses the returned entries to display the "Ambiguous
name" dialog.

How can I find all contacts with particular name (fom all folders) ?
 
D

Dmitry Streblechenko

All contacts from conatcts folders in a particular store?
All address entries from all address book containers in the address book?
The two are different as you can have a contacts folder in a store that does
not show up in the address book ("Show in teh address book" checkbox is nto
checked). Plus you can have other AB providers (such as GAL) that have
nothign to do with contact messages in a message store.

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

Sergeichik

Dmitry Streblechenko said:
All contacts from conatcts folders in a particular store?
All address entries from all address book containers in the address book?


All contacts that can be available to user from Outlook Address book.
 
D

Dmitry Streblechenko

Opne the address book, open the root container, (IAddrBook::OpenEntry(0,
NULL, ...)), get all the subcontainers (IABContainer::GetHierarchyTable).
For each container, open it (IAddrBook::OpenEntry - get back IABContainer),
get the contents table (IABContainer::GetContentsTable), perform PR_ANR
restriction (IMAPITable::Restrict).

--
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