How to read all contacts with the same name.

S

Sergeichik

How to read all contacts from Outlook Address book with some particular name,
for example 'Sunny', (from all folders) programmatically.
Can I do it with ResolveName() function ? It stops at the first founded
contact.
 
D

Dmitry Streblechenko

As I mentioned in my prrevious reply, perform PR_ANR restriction on all
address book containers that you want to process.

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

Sergeichik

Dmitry Streblechenko said:
As I mentioned in my prrevious reply, perform PR_ANR restriction on all
address book containers that you want to process.


Can you give any example ?
 
S

Sergeichik

Dmitry Streblechenko said:
As I mentioned in my prrevious reply, perform PR_ANR restriction on all
address book containers that you want to process.


Should I process containers in cycle and use ResolveName() for each of them?
 
S

Sergeichik

Dmitry Streblechenko said:
As I mentioned in my prrevious reply, perform PR_ANR restriction on all
address book containers that you want to process.

May you give an example of such PR_ANR restriction ?
 
D

Dmitry Streblechenko

It is a regular RES_PROPERTY restriction:

Restr.rt:=RES_PROPERTY;
Restr.res.resProperty.relop:=RELOP_EQ;
Restr.res.resProperty.ulPropTag:=PR_ANR;
Restr.res.resProperty.lpProp:=@Prop;
Prop.ulPropTag:=PR_ANR;
Prop.Value.lpszA:=PChar(strName);
res:=HrQueryAllRows(Tbl, @GALColumns, @Restr, nil, 0, pRows);


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

Dmitry Streblechenko

Yes, do that in a loop. But ResolveName won't help you if you have multipe
entries with ambiguous names - use PR_ANR restriction.

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