Contacts from ExMAPI

Contacts from ExMAPI

Post by Maulik Pate » Sat, 12 Jul 2003 00:10:22



Dear Experts ,

I am still facing 2 problems ...

Problem 1:

My Code , now retrieves all contacts from various address containers ...

.........................

IAddrBook->OpenEntry(...)

..

 // Get the entryid of the root AddressBook container
  hr = pAddrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL,
0,(ULONG*)&ulObjType,(LPUNKNOWN *)&lpContainer);

  hr = lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);

.............................
etc..etc...

But i have noticed that ,  you cannot retrive a contact who doesn't have a
email address ...
for me , email address  is not important  , since i only want to retrieve
Mobile Phone Number ...
OutlookSpy also doesn't show those contacts ..(when clicking from IAddrBook
CommandButton ..)

Is there any way to sepecify , "include all contact items ,, even if they
don't have an email address !"

Problem 2:

Can someone send me the code (sample!) , for retrieving a Named Property
from a contact item ?

PR_CELLULAR_TELEPHONE_NUMBER or PR_MOBILE_TELEPHONE_NUMBER

Thanks a lot ....

Sincerely ,

Maulik Patel

 
 
 

Contacts from ExMAPI

Post by Dmitry Streblechenk » Sat, 12 Jul 2003 02:58:06


1. You need to work with the IPM.Contact messages directly in the Contacts
folder rather than going through IAddrBook
2. You need to retrieve the corresponding named properties. Did you read my
reply to your previous question?

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


Quote:> Dear Experts ,

> I am still facing 2 problems ...

> Problem 1:

> My Code , now retrieves all contacts from various address containers ...

> .........................

> IAddrBook->OpenEntry(...)

> ..

>  // Get the entryid of the root AddressBook container
>   hr = pAddrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL,
> 0,(ULONG*)&ulObjType,(LPUNKNOWN *)&lpContainer);

>   hr = lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);

> .............................
> etc..etc...

> But i have noticed that ,  you cannot retrive a contact who doesn't have a
> email address ...
> for me , email address  is not important  , since i only want to retrieve
> Mobile Phone Number ...
> OutlookSpy also doesn't show those contacts ..(when clicking from
IAddrBook
> CommandButton ..)

> Is there any way to sepecify , "include all contact items ,, even if they
> don't have an email address !"

> Problem 2:

> Can someone send me the code (sample!) , for retrieving a Named Property
> from a contact item ?

> PR_CELLULAR_TELEPHONE_NUMBER or PR_MOBILE_TELEPHONE_NUMBER

> Thanks a lot ....

> Sincerely ,

> Maulik Patel


 
 
 

Contacts from ExMAPI

Post by Maulik Pate » Sat, 12 Jul 2003 03:52:36


Thanks Dimitry.

Unfortunately this will solve only part of my problem.


> 1. You need to work with the IPM.Contact messages directly in the Contacts
> folder rather than going through IAddrBook
> 2. You need to retrieve the corresponding named properties. Did you read
my
> reply to your previous question?

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



> > Dear Experts ,

> > I am still facing 2 problems ...

> > Problem 1:

> > My Code , now retrieves all contacts from various address containers ...

> > .........................

> > IAddrBook->OpenEntry(...)

> > ..

> >  // Get the entryid of the root AddressBook container
> >   hr = pAddrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL,
> > 0,(ULONG*)&ulObjType,(LPUNKNOWN *)&lpContainer);

> >   hr = lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);

> > .............................
> > etc..etc...

> > But i have noticed that ,  you cannot retrive a contact who doesn't have
a
> > email address ...
> > for me , email address  is not important  , since i only want to
retrieve
> > Mobile Phone Number ...
> > OutlookSpy also doesn't show those contacts ..(when clicking from
> IAddrBook
> > CommandButton ..)

> > Is there any way to sepecify , "include all contact items ,, even if
they
> > don't have an email address !"

> > Problem 2:

> > Can someone send me the code (sample!) , for retrieving a Named Property
> > from a contact item ?

> > PR_CELLULAR_TELEPHONE_NUMBER or PR_MOBILE_TELEPHONE_NUMBER

> > Thanks a lot ....

> > Sincerely ,

> > Maulik Patel

 
 
 

Contacts from ExMAPI

Post by Maulik Pate » Sat, 12 Jul 2003 04:16:25


Sorry..

I have 2 type of code :
1. Code that scans all contact folders for contact items & distribution
lists ..
2. Code that uses IAddrBook  &  IMAPISession*  psession->OpenAddressBook
...etc    for retrieving all AddressContainers & it's Content table

Code no.2 woks well & it's quick .. but the problem is  , as you said ,
can't get Mobile Number for a purticular entry  using IAddrBook ..

Code no.1 works ...but the problem is :

but any contact folder can have a distribution lists also .. (recursively
distribution list can contain another d-lists ..)

if i want to open a distribution list inside a folder ,
you have suggested :

" You can retrieve all the members of a distribution lists in the contacts
folders
 using the regular IMessage interface - entry ids of all the dist list
 members
 are stored in the named property with id = 0x8054 and GUID =
 {00062004-0000-0000-C000-000000000046}. It is a PT_MV_BINARY property,
just  retrieve each element and call IAddrBook::OpenEntry() - you will get
back
 IMailUser of that member.  "

So , even after i can open it , i will still have a problem of getting Named
proprety (mobile phone number) from it  because of IAddrBook ...

I am kind of stuck ..and can't find a way around ... i am trying as much as
i can ..(past 4 days , 10 hours a day ..trying just to find out solution for
this !)
( I don't see any reason , why there is very little documentation for ExMAPI
from Micro$oft ....)

I should be able to get all contacts & their mobile numbers from
outlook/exchange..
(Contact folders + D-lists + Public folders + GALs + other address lists
..etc..)

Sorry again ..(if i wasted ur time ..)

Thanks ....


> 1. You need to work with the IPM.Contact messages directly in the Contacts
> folder rather than going through IAddrBook
> 2. You need to retrieve the corresponding named properties. Did you read
my
> reply to your previous question?

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



> > Dear Experts ,

> > I am still facing 2 problems ...

> > Problem 1:

> > My Code , now retrieves all contacts from various address containers ...

> > .........................

> > IAddrBook->OpenEntry(...)

> > ..

> >  // Get the entryid of the root AddressBook container
> >   hr = pAddrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL,
> > 0,(ULONG*)&ulObjType,(LPUNKNOWN *)&lpContainer);

> >   hr = lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);

> > .............................
> > etc..etc...

> > But i have noticed that ,  you cannot retrive a contact who doesn't have
a
> > email address ...
> > for me , email address  is not important  , since i only want to
retrieve
> > Mobile Phone Number ...
> > OutlookSpy also doesn't show those contacts ..(when clicking from
> IAddrBook
> > CommandButton ..)

> > Is there any way to sepecify , "include all contact items ,, even if
they
> > don't have an email address !"

> > Problem 2:

> > Can someone send me the code (sample!) , for retrieving a Named Property
> > from a contact item ?

> > PR_CELLULAR_TELEPHONE_NUMBER or PR_MOBILE_TELEPHONE_NUMBER

> > Thanks a lot ....

> > Sincerely ,

> > Maulik Patel

 
 
 

Contacts from ExMAPI

Post by Daniel Mitchell [MVP » Sat, 12 Jul 2003 04:45:31




Quote:> Can someone send me the code (sample!) , for retrieving a Named Property
> from a contact item ?

 ftp://ftp.microsoft.com/developr/MAPI/Samples/MFCAPPS/MFCAPPS.ZIP contains
code that does GetIDsFromNames (and the reverse, and a lot of other
handy ExMAPI stuff).

 -- dan

 
 
 

Contacts from ExMAPI

Post by Dmitry Streblechenk » Sat, 12 Jul 2003 05:07:01


How do you call GetIDsFromNames() to retrieve the phone # prop tag?

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


> Sorry..

> I have 2 type of code :
> 1. Code that scans all contact folders for contact items & distribution
> lists ..
> 2. Code that uses IAddrBook  &  IMAPISession*  psession->OpenAddressBook
> ...etc    for retrieving all AddressContainers & it's Content table

> Code no.2 woks well & it's quick .. but the problem is  , as you said ,
> can't get Mobile Number for a purticular entry  using IAddrBook ..

> Code no.1 works ...but the problem is :

> but any contact folder can have a distribution lists also .. (recursively
> distribution list can contain another d-lists ..)

> if i want to open a distribution list inside a folder ,
> you have suggested :

> " You can retrieve all the members of a distribution lists in the contacts
> folders
>  using the regular IMessage interface - entry ids of all the dist list
>  members
>  are stored in the named property with id = 0x8054 and GUID =
>  {00062004-0000-0000-C000-000000000046}. It is a PT_MV_BINARY property,
> just  retrieve each element and call IAddrBook::OpenEntry() - you will get
> back
>  IMailUser of that member.  "

> So , even after i can open it , i will still have a problem of getting
Named
> proprety (mobile phone number) from it  because of IAddrBook ...

> I am kind of stuck ..and can't find a way around ... i am trying as much
as
> i can ..(past 4 days , 10 hours a day ..trying just to find out solution
for
> this !)
> ( I don't see any reason , why there is very little documentation for
ExMAPI
> from Micro$oft ....)

> I should be able to get all contacts & their mobile numbers from
> outlook/exchange..
> (Contact folders + D-lists + Public folders + GALs + other address lists
> ..etc..)

> Sorry again ..(if i wasted ur time ..)

> Thanks ....



> > 1. You need to work with the IPM.Contact messages directly in the
Contacts
> > folder rather than going through IAddrBook
> > 2. You need to retrieve the corresponding named properties. Did you read
> my
> > reply to your previous question?

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



> > > Dear Experts ,

> > > I am still facing 2 problems ...

> > > Problem 1:

> > > My Code , now retrieves all contacts from various address containers
...

> > > .........................

> > > IAddrBook->OpenEntry(...)

> > > ..

> > >  // Get the entryid of the root AddressBook container
> > >   hr = pAddrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL,
> > > 0,(ULONG*)&ulObjType,(LPUNKNOWN *)&lpContainer);

> > >   hr = lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);

> > > .............................
> > > etc..etc...

> > > But i have noticed that ,  you cannot retrive a contact who doesn't
have
> a
> > > email address ...
> > > for me , email address  is not important  , since i only want to
> retrieve
> > > Mobile Phone Number ...
> > > OutlookSpy also doesn't show those contacts ..(when clicking from
> > IAddrBook
> > > CommandButton ..)

> > > Is there any way to sepecify , "include all contact items ,, even if
> they
> > > don't have an email address !"

> > > Problem 2:

> > > Can someone send me the code (sample!) , for retrieving a Named
Property
> > > from a contact item ?

> > > PR_CELLULAR_TELEPHONE_NUMBER or PR_MOBILE_TELEPHONE_NUMBER

> > > Thanks a lot ....

> > > Sincerely ,

> > > Maulik Patel

 
 
 

Contacts from ExMAPI

Post by Maulik Pate » Sat, 12 Jul 2003 05:25:42


I am Very Very new to ExMAPI ... if i am doing sothing very stupid here
...then please forgive me ...

do think , i should try GetIDsFromNames() stuff on IAddrBook entries ?

here is what i tried,

long uID1=-1;
GetIDForName(lpContainer,"PR_MOBILE_TELEPHONE_NUMBER",&uID1);

LPSPropValue sProp=NULL;
HrGetOneProp(lpContainer,uID1 | PT_TSTRING,&sProp);

HRESULT GetIDForName(IABContainer* pMsg, const char * szName, long * plID)
{
    MAPINAMEID mid;
    mid.lpguid = (LPGUID)&PS_PUBLIC_STRINGS;
    mid.ulKind = MNID_STRING;
    char tb[256*2]; // ick!
    mid.Kind.lpwstrName = (wchar_t*)tb;

    MultiByteToWideChar((UINT)CP_ACP,
        (DWORD)0,
        szName,
        -1,
        (unsigned short *)tb, // ick!
        256);

    LPMAPINAMEID pmid = ∣

    LPSPropTagArray ptaga = NULL;
    HRESULT hr = pMsg->GetIDsFromNames(1, &pmid,0, &ptaga);

    if (FAILED(hr))
    {
        return hr;
    }

    *plID = ptaga[0].aulPropTag[0];

    MAPIFreeBuffer(ptaga);

    return S_OK;

Quote:}

i know ,  pMsg should be of  IMessage*  type ...
But i want to get that named property from AddressBook Entry ...

also tried,

    LPSPropValue
lpspv=PpropFindProp(msrows3->aRow[i].lpProps,msrows3->aRow[i].cValues,PR_CEL
LULAR_TELEPHONE_NUMBER);
    if(lpspv) name_2=lpspv->Value.lpszA;

Thanks.


> How do you call GetIDsFromNames() to retrieve the phone # prop tag?

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



> > Sorry..

> > I have 2 type of code :
> > 1. Code that scans all contact folders for contact items & distribution
> > lists ..
> > 2. Code that uses IAddrBook  &  IMAPISession*  psession->OpenAddressBook
> > ...etc    for retrieving all AddressContainers & it's Content table

> > Code no.2 woks well & it's quick .. but the problem is  , as you said ,
> > can't get Mobile Number for a purticular entry  using IAddrBook ..

> > Code no.1 works ...but the problem is :

> > but any contact folder can have a distribution lists also ..
(recursively
> > distribution list can contain another d-lists ..)

> > if i want to open a distribution list inside a folder ,
> > you have suggested :

> > " You can retrieve all the members of a distribution lists in the
contacts
> > folders
> >  using the regular IMessage interface - entry ids of all the dist list
> >  members
> >  are stored in the named property with id = 0x8054 and GUID =
> >  {00062004-0000-0000-C000-000000000046}. It is a PT_MV_BINARY property,
> > just  retrieve each element and call IAddrBook::OpenEntry() - you will
get
> > back
> >  IMailUser of that member.  "

> > So , even after i can open it , i will still have a problem of getting
> Named
> > proprety (mobile phone number) from it  because of IAddrBook ...

> > I am kind of stuck ..and can't find a way around ... i am trying as much
> as
> > i can ..(past 4 days , 10 hours a day ..trying just to find out solution
> for
> > this !)
> > ( I don't see any reason , why there is very little documentation for
> ExMAPI
> > from Micro$oft ....)

> > I should be able to get all contacts & their mobile numbers from
> > outlook/exchange..
> > (Contact folders + D-lists + Public folders + GALs + other address lists
> > ..etc..)

> > Sorry again ..(if i wasted ur time ..)

> > Thanks ....



> > > 1. You need to work with the IPM.Contact messages directly in the
> Contacts
> > > folder rather than going through IAddrBook
> > > 2. You need to retrieve the corresponding named properties. Did you
read
> > my
> > > reply to your previous question?

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



> > > > Dear Experts ,

> > > > I am still facing 2 problems ...

> > > > Problem 1:

> > > > My Code , now retrieves all contacts from various address containers
> ...

> > > > .........................

> > > > IAddrBook->OpenEntry(...)

> > > > ..

> > > >  // Get the entryid of the root AddressBook container
> > > >   hr = pAddrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL,
> > > > 0,(ULONG*)&ulObjType,(LPUNKNOWN *)&lpContainer);

> > > >   hr = lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);

> > > > .............................
> > > > etc..etc...

> > > > But i have noticed that ,  you cannot retrive a contact who doesn't
> have
> > a
> > > > email address ...
> > > > for me , email address  is not important  , since i only want to
> > retrieve
> > > > Mobile Phone Number ...
> > > > OutlookSpy also doesn't show those contacts ..(when clicking from
> > > IAddrBook
> > > > CommandButton ..)

> > > > Is there any way to sepecify , "include all contact items ,, even if
> > they
> > > > don't have an email address !"

> > > > Problem 2:

> > > > Can someone send me the code (sample!) , for retrieving a Named
> Property
> > > > from a contact item ?

> > > > PR_CELLULAR_TELEPHONE_NUMBER or PR_MOBILE_TELEPHONE_NUMBER

> > > > Thanks a lot ....

> > > > Sincerely ,

> > > > Maulik Patel

 
 
 

Contacts from ExMAPI

Post by Dmitry Streblechenk » Sat, 12 Jul 2003 06:41:33


No, you need to call IMessage::GetIDsFromNames() passing the GUID and id
(either a string or an integer).
Look at the contact with OutlookSpy (select a contact, click IMessage
button), select the property that holds the data you are after (it'll be in
the 0x8xxx form), look at the "Named Property" box on the right hand side.
BTW, Outlook address book does not support named properties.

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


Quote:> I am Very Very new to ExMAPI ... if i am doing sothing very stupid here
> ...then please forgive me ...

> do think , i should try GetIDsFromNames() stuff on IAddrBook entries ?

> here is what i tried,

> long uID1=-1;
> GetIDForName(lpContainer,"PR_MOBILE_TELEPHONE_NUMBER",&uID1);

> LPSPropValue sProp=NULL;
> HrGetOneProp(lpContainer,uID1 | PT_TSTRING,&sProp);

> HRESULT GetIDForName(IABContainer* pMsg, const char * szName, long * plID)
> {
>     MAPINAMEID mid;
>     mid.lpguid = (LPGUID)&PS_PUBLIC_STRINGS;
>     mid.ulKind = MNID_STRING;
>     char tb[256*2]; // ick!
>     mid.Kind.lpwstrName = (wchar_t*)tb;

>     MultiByteToWideChar((UINT)CP_ACP,
>         (DWORD)0,
>         szName,
>         -1,
>         (unsigned short *)tb, // ick!
>         256);

>     LPMAPINAMEID pmid = ∣

>     LPSPropTagArray ptaga = NULL;
>     HRESULT hr = pMsg->GetIDsFromNames(1, &pmid,0, &ptaga);

>     if (FAILED(hr))
>     {
>         return hr;
>     }

>     *plID = ptaga[0].aulPropTag[0];

>     MAPIFreeBuffer(ptaga);

>     return S_OK;
> }

> i know ,  pMsg should be of  IMessage*  type ...
> But i want to get that named property from AddressBook Entry ...

> also tried,

>     LPSPropValue

lpspv=PpropFindProp(msrows3->aRow[i].lpProps,msrows3->aRow[i].cValues,PR_CEL

- Show quoted text -

> LULAR_TELEPHONE_NUMBER);
>     if(lpspv) name_2=lpspv->Value.lpszA;

> Thanks.



> > How do you call GetIDsFromNames() to retrieve the phone # prop tag?

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



> > > Sorry..

> > > I have 2 type of code :
> > > 1. Code that scans all contact folders for contact items &
distribution
> > > lists ..
> > > 2. Code that uses IAddrBook  &  IMAPISession*

psession->OpenAddressBook

- Show quoted text -

> > > ...etc    for retrieving all AddressContainers & it's Content table

> > > Code no.2 woks well & it's quick .. but the problem is  , as you said
,
> > > can't get Mobile Number for a purticular entry  using IAddrBook ..

> > > Code no.1 works ...but the problem is :

> > > but any contact folder can have a distribution lists also ..
> (recursively
> > > distribution list can contain another d-lists ..)

> > > if i want to open a distribution list inside a folder ,
> > > you have suggested :

> > > " You can retrieve all the members of a distribution lists in the
> contacts
> > > folders
> > >  using the regular IMessage interface - entry ids of all the dist list
> > >  members
> > >  are stored in the named property with id = 0x8054 and GUID =
> > >  {00062004-0000-0000-C000-000000000046}. It is a PT_MV_BINARY
property,
> > > just  retrieve each element and call IAddrBook::OpenEntry() - you will
> get
> > > back
> > >  IMailUser of that member.  "

> > > So , even after i can open it , i will still have a problem of getting
> > Named
> > > proprety (mobile phone number) from it  because of IAddrBook ...

> > > I am kind of stuck ..and can't find a way around ... i am trying as
much
> > as
> > > i can ..(past 4 days , 10 hours a day ..trying just to find out
solution
> > for
> > > this !)
> > > ( I don't see any reason , why there is very little documentation for
> > ExMAPI
> > > from Micro$oft ....)

> > > I should be able to get all contacts & their mobile numbers from
> > > outlook/exchange..
> > > (Contact folders + D-lists + Public folders + GALs + other address
lists
> > > ..etc..)

> > > Sorry again ..(if i wasted ur time ..)

> > > Thanks ....



> > > > 1. You need to work with the IPM.Contact messages directly in the
> > Contacts
> > > > folder rather than going through IAddrBook
> > > > 2. You need to retrieve the corresponding named properties. Did you
> read
> > > my
> > > > reply to your previous question?

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



> > > > > Dear Experts ,

> > > > > I am still facing 2 problems ...

> > > > > Problem 1:

> > > > > My Code , now retrieves all contacts from various address
containers
> > ...

> > > > > .........................

> > > > > IAddrBook->OpenEntry(...)

> > > > > ..

> > > > >  // Get the entryid of the root AddressBook container
> > > > >   hr = pAddrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL,
> > > > > 0,(ULONG*)&ulObjType,(LPUNKNOWN *)&lpContainer);

> > > > >   hr = lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);

> > > > > .............................
> > > > > etc..etc...

> > > > > But i have noticed that ,  you cannot retrive a contact who
doesn't
> > have
> > > a
> > > > > email address ...
> > > > > for me , email address  is not important  , since i only want to
> > > retrieve
> > > > > Mobile Phone Number ...
> > > > > OutlookSpy also doesn't show those contacts ..(when clicking from
> > > > IAddrBook
> > > > > CommandButton ..)

> > > > > Is there any way to sepecify , "include all contact items ,, even
if
> > > they
> > > > > don't have an email address !"

> > > > > Problem 2:

> > > > > Can someone send me the code (sample!) , for retrieving a Named
> > Property
> > > > > from a contact item ?

> > > > > PR_CELLULAR_TELEPHONE_NUMBER or PR_MOBILE_TELEPHONE_NUMBER

> > > > > Thanks a lot ....

> > > > > Sincerely ,

> > > > > Maulik Patel

 
 
 

Contacts from ExMAPI

Post by Maulik Pate » Sat, 12 Jul 2003 15:03:34


Thanks.

The  property that holds the data i am after   is
PR_CELLULAR_TELEPHONE_NUMBER.
When click on it in OutlookSpy , Named Property section disappears ...
(it is out of   0x8xxxxx  range and not hilighted ...)

however , in my code , i can directly retrieve this property ..

void RetriveMsgProperties(IMessage* imsg){

 SizedSPropTagArray(6, mcols) = {6,

{PR_ENTRYID,PR_MESSAGE_CLASS,PR_DISPLAY_NAME,PR_SURNAME,PR_GIVEN_NAME,PR_CEL
LULAR_TELEPHONE_NUMBER}};

 ULONG pcount; SPropValue *props=0; HRESULT hr;
 hr = imsg->GetProps((SPropTagArray*)&mcols,0,&pcount,&props);

 if (props[5].ulPropTag==PR_CELLULAR_TELEPHONE_NUMBER) {
    mTmp1 = props[5].Value.lpszA;
 }

..................

on the other hand ,

When i get , IMailUser  from IABContainer  in OutlookSpy .. ,
After GetProps() , i can see PR_CELLULAR_TELEPHONE_NUMBER  ....

Should i try , doing GetProps() and searching for this tag ?

Cheers,

Maulik

"Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message

news:uxpdJwyRDHA.2408@TK2MSFTNGP10.phx.gbl...
> No, you need to call IMessage::GetIDsFromNames() passing the GUID and id
> (either a string or an integer).
> Look at the contact with OutlookSpy (select a contact, click IMessage
> button), select the property that holds the data you are after (it'll be
in
> the 0x8xxx form), look at the "Named Property" box on the right hand side.
> BTW, Outlook address book does not support named properties.

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

> "Maulik Patel" <mau...@cylish.com> wrote in message
> news:eh9liFyRDHA.2676@TK2MSFTNGP10.phx.gbl...
> > I am Very Very new to ExMAPI ... if i am doing sothing very stupid here
> > ...then please forgive me ...

> > do think , i should try GetIDsFromNames() stuff on IAddrBook entries ?

> > here is what i tried,

> > long uID1=-1;
> > GetIDForName(lpContainer,"PR_MOBILE_TELEPHONE_NUMBER",&uID1);

> > LPSPropValue sProp=NULL;
> > HrGetOneProp(lpContainer,uID1 | PT_TSTRING,&sProp);

> > HRESULT GetIDForName(IABContainer* pMsg, const char * szName, long *
plID)
> > {
> >     MAPINAMEID mid;
> >     mid.lpguid = (LPGUID)&PS_PUBLIC_STRINGS;
> >     mid.ulKind = MNID_STRING;
> >     char tb[256*2]; // ick!
> >     mid.Kind.lpwstrName = (wchar_t*)tb;

> >     MultiByteToWideChar((UINT)CP_ACP,
> >         (DWORD)0,
> >         szName,
> >         -1,
> >         (unsigned short *)tb, // ick!
> >         256);

> >     LPMAPINAMEID pmid = &mid;

> >     LPSPropTagArray ptaga = NULL;
> >     HRESULT hr = pMsg->GetIDsFromNames(1, &pmid,0, &ptaga);

> >     if (FAILED(hr))
> >     {
> >         return hr;
> >     }

> >     *plID = ptaga[0].aulPropTag[0];

> >     MAPIFreeBuffer(ptaga);

> >     return S_OK;
> > }

> > i know ,  pMsg should be of  IMessage*  type ...
> > But i want to get that named property from AddressBook Entry ...

> > also tried,

> >     LPSPropValue

lpspv=PpropFindProp(msrows3->aRow[i].lpProps,msrows3->aRow[i].cValues,PR_CEL

- Show quoted text -

> > LULAR_TELEPHONE_NUMBER);
> >     if(lpspv) name_2=lpspv->Value.lpszA;

> > Thanks.

> > "Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message
> > news:eR0tU7xRDHA.2480@tk2msftngp13.phx.gbl...
> > > How do you call GetIDsFromNames() to retrieve the phone # prop tag?

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

> > > "Maulik Patel" <mau...@cylish.com> wrote in message
> > > news:O6OC1exRDHA.1720@TK2MSFTNGP10.phx.gbl...
> > > > Sorry..

> > > > I have 2 type of code :
> > > > 1. Code that scans all contact folders for contact items &
> distribution
> > > > lists ..
> > > > 2. Code that uses IAddrBook  &  IMAPISession*
> psession->OpenAddressBook
> > > > ...etc    for retrieving all AddressContainers & it's Content table

> > > > Code no.2 woks well & it's quick .. but the problem is  , as you
said
> ,
> > > > can't get Mobile Number for a purticular entry  using IAddrBook ..

> > > > Code no.1 works ...but the problem is :

> > > > but any contact folder can have a distribution lists also ..
> > (recursively
> > > > distribution list can contain another d-lists ..)

> > > > if i want to open a distribution list inside a folder ,
> > > > you have suggested :

> > > > " You can retrieve all the members of a distribution lists in the
> > contacts
> > > > folders
> > > >  using the regular IMessage interface - entry ids of all the dist
list
> > > >  members
> > > >  are stored in the named property with id = 0x8054 and GUID =
> > > >  {00062004-0000-0000-C000-000000000046}. It is a PT_MV_BINARY
> property,
> > > > just  retrieve each element and call IAddrBook::OpenEntry() - you
will
> > get
> > > > back
> > > >  IMailUser of that member.  "

> > > > So , even after i can open it , i will still have a problem of
getting
> > > Named
> > > > proprety (mobile phone number) from it  because of IAddrBook ...

> > > > I am kind of stuck ..and can't find a way around ... i am trying as
> much
> > > as
> > > > i can ..(past 4 days , 10 hours a day ..trying just to find out
> solution
> > > for
> > > > this !)
> > > > ( I don't see any reason , why there is very little documentation
for
> > > ExMAPI
> > > > from Micro$oft ....)

> > > > I should be able to get all contacts & their mobile numbers from
> > > > outlook/exchange..
> > > > (Contact folders + D-lists + Public folders + GALs + other address
> lists
> > > > ..etc..)

> > > > Sorry again ..(if i wasted ur time ..)

> > > > Thanks ....

> > > > "Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message
> > > > news:OnVjRzwRDHA.2148@TK2MSFTNGP10.phx.gbl...
> > > > > 1. You need to work with the IPM.Contact messages directly in the
> > > Contacts
> > > > > folder rather than going through IAddrBook
> > > > > 2. You need to retrieve the corresponding named properties. Did
you
> > read
> > > > my
> > > > > reply to your previous question?

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

> > > > > "Maulik Patel" <mau...@cylish.com> wrote in message
> > > > > news:erzqXVvRDHA.2236@tk2msftngp13.phx.gbl...
> > > > > > Dear Experts ,

> > > > > > I am still facing 2 problems ...

> > > > > > Problem 1:

> > > > > > My Code , now retrieves all contacts from various address
> containers
> > > ...

> > > > > > .........................

> > > > > > IAddrBook->OpenEntry(...)

> > > > > > ..

> > > > > >  // Get the entryid of the root AddressBook container
> > > > > >   hr = pAddrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL,
> > > > > > 0,(ULONG*)&ulObjType,(LPUNKNOWN *)&lpContainer);

> > > > > >   hr =

lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);

- Show quoted text -

> > > > > > .............................
> > > > > > etc..etc...

> > > > > > But i have noticed that ,  you cannot retrive a contact who
> doesn't
> > > have
> > > > a
> > > > > > email address ...
> > > > > > for me , email address  is not important  , since i only want to
> > > > retrieve
> > > > > > Mobile Phone Number ...
> > > > > > OutlookSpy also doesn't show those contacts ..(when clicking
from
> > > > > IAddrBook
> > > > > > CommandButton ..)

> > > > > > Is there any way to sepecify , "include all contact items ,,
even
> if
> > > > they
> > > > > > don't have an email address !"

> > > > > > Problem 2:

> > > > > > Can someone send me the code (sample!) , for retrieving a Named
> > > Property
> > > > > > from a contact item ?

> > > > > > PR_CELLULAR_TELEPHONE_NUMBER or PR_MOBILE_TELEPHONE_NUMBER

> > > > > > Thanks a lot ....

> > > > > > Sincerely ,

> > > > > > Maulik Patel

 
 
 

Contacts from ExMAPI

Post by Maulik Pate » Sat, 12 Jul 2003 18:40:30


Long live OutlookSpy !

dammnnn.... i got this working ...this way for IAddrBook,
i can get , mobile number of a contact item reciding as an address book
entry.

 ......
 IABContainer *lpContainer=NULL;
 ........
 IMAPITable* lpAB;
 hr = lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);
 .........
 hr = pHrQueryAllRows(lpAB,(SPropTagArray*)&ptaEid,NULL,NULL,0,&msrows3);
 ........
   if (msrows3->aRow[i].lpProps[0].ulPropTag==PR_ENTRYID)
eid_1=&msrows3->aRow[i].lpProps[0];
   if (msrows3->aRow[i].lpProps[2].ulPropTag==PR_OBJECT_TYPE)
mObjClass=msrows3->aRow[i].lpProps[2].Value.bin.cb;
...........
   if(mObjClass==MAPI_DISTLIST){       // Scan Recursive ...
   }else if(mObjClass==MAPI_MAILUSER){
..........

//  THE CODE  - START

    LPMAILUSER lpMailUser;
    ULONG ulObjType2=-1;
    hr = pAddrBook->OpenEntry(msrows3->aRow[i].lpProps[0].Value.bin.cb,
                 (LPENTRYID)msrows3->aRow[i].lpProps[0].Value.bin.lpb,
                 &IID_IMailUser, // interface (use the default intereface)
                 0, // flags
                 &ulObjType2,
                 (LPUNKNOWN *)&lpMailUser);

    if(lpMailUser)
    {
       ULONG ulcValues = 0;
       LPSPropValue lpPropArray;

       lpMailUser->GetProps(NULL, 0, &ulcValues, &lpPropArray); //get the
properties from the mail user.

       //if(lpPropArray) LPSPropValue
lpspv=PpropFindProp(lpPropArray,ulcValues,PR_MOBILE_TELEPHONE_NUMBER);

       name_2="";
      for(int k=0;k<ulcValues;k++)
        if(lpPropArray[k].ulPropTag==PR_CELLULAR_TELEPHONE_NUMBER)
           name_2=lpPropArray[k].Value.lpszA;

       MAPIFreeBuffer(lpMailUser); //release the user once we have the
properites
    }

//  THE CODE  - END

Does it look buggy ? or is It safe to do this way ?
( pls let me know ...if it isn't !)

Now , there are 2 concerns :

is it possible for IAddrBook to get contacts even if they don't have email
addess ?
If a Outlook folder is exposed as AddressBook , that addressbook will show
only those contacts that have an email address !

How to retrieve Distribution list entries from a IMessage/IMAPIFolder ?
I am trying get a solution from Dmitry's suggestions.

Cheers,

Maulik Patel

"Maulik Patel" <mau...@cylish.com> wrote in message

news:uUYudI3RDHA.2144@TK2MSFTNGP11.phx.gbl...
> Thanks.

> The  property that holds the data i am after   is
> PR_CELLULAR_TELEPHONE_NUMBER.
> When click on it in OutlookSpy , Named Property section disappears ...
> (it is out of   0x8xxxxx  range and not hilighted ...)

> however , in my code , i can directly retrieve this property ..

> void RetriveMsgProperties(IMessage* imsg){

>  SizedSPropTagArray(6, mcols) = {6,

{PR_ENTRYID,PR_MESSAGE_CLASS,PR_DISPLAY_NAME,PR_SURNAME,PR_GIVEN_NAME,PR_CEL
> LULAR_TELEPHONE_NUMBER}};

>  ULONG pcount; SPropValue *props=0; HRESULT hr;
>  hr = imsg->GetProps((SPropTagArray*)&mcols,0,&pcount,&props);

>  if (props[5].ulPropTag==PR_CELLULAR_TELEPHONE_NUMBER) {
>     mTmp1 = props[5].Value.lpszA;
>  }

> ..................

> on the other hand ,

> When i get , IMailUser  from IABContainer  in OutlookSpy .. ,
> After GetProps() , i can see PR_CELLULAR_TELEPHONE_NUMBER  ....

> Should i try , doing GetProps() and searching for this tag ?

> Cheers,

> Maulik

> "Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message
> news:uxpdJwyRDHA.2408@TK2MSFTNGP10.phx.gbl...
> > No, you need to call IMessage::GetIDsFromNames() passing the GUID and id
> > (either a string or an integer).
> > Look at the contact with OutlookSpy (select a contact, click IMessage
> > button), select the property that holds the data you are after (it'll be
> in
> > the 0x8xxx form), look at the "Named Property" box on the right hand
side.
> > BTW, Outlook address book does not support named properties.

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

> > "Maulik Patel" <mau...@cylish.com> wrote in message
> > news:eh9liFyRDHA.2676@TK2MSFTNGP10.phx.gbl...
> > > I am Very Very new to ExMAPI ... if i am doing sothing very stupid
here
> > > ...then please forgive me ...

> > > do think , i should try GetIDsFromNames() stuff on IAddrBook entries ?

> > > here is what i tried,

> > > long uID1=-1;
> > > GetIDForName(lpContainer,"PR_MOBILE_TELEPHONE_NUMBER",&uID1);

> > > LPSPropValue sProp=NULL;
> > > HrGetOneProp(lpContainer,uID1 | PT_TSTRING,&sProp);

> > > HRESULT GetIDForName(IABContainer* pMsg, const char * szName, long *
> plID)
> > > {
> > >     MAPINAMEID mid;
> > >     mid.lpguid = (LPGUID)&PS_PUBLIC_STRINGS;
> > >     mid.ulKind = MNID_STRING;
> > >     char tb[256*2]; // ick!
> > >     mid.Kind.lpwstrName = (wchar_t*)tb;

> > >     MultiByteToWideChar((UINT)CP_ACP,
> > >         (DWORD)0,
> > >         szName,
> > >         -1,
> > >         (unsigned short *)tb, // ick!
> > >         256);

> > >     LPMAPINAMEID pmid = &mid;

> > >     LPSPropTagArray ptaga = NULL;
> > >     HRESULT hr = pMsg->GetIDsFromNames(1, &pmid,0, &ptaga);

> > >     if (FAILED(hr))
> > >     {
> > >         return hr;
> > >     }

> > >     *plID = ptaga[0].aulPropTag[0];

> > >     MAPIFreeBuffer(ptaga);

> > >     return S_OK;
> > > }

> > > i know ,  pMsg should be of  IMessage*  type ...
> > > But i want to get that named property from AddressBook Entry ...

> > > also tried,

> > >     LPSPropValue

lpspv=PpropFindProp(msrows3->aRow[i].lpProps,msrows3->aRow[i].cValues,PR_CEL

- Show quoted text -

> > > LULAR_TELEPHONE_NUMBER);
> > >     if(lpspv) name_2=lpspv->Value.lpszA;

> > > Thanks.

> > > "Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message
> > > news:eR0tU7xRDHA.2480@tk2msftngp13.phx.gbl...
> > > > How do you call GetIDsFromNames() to retrieve the phone # prop tag?

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

> > > > "Maulik Patel" <mau...@cylish.com> wrote in message
> > > > news:O6OC1exRDHA.1720@TK2MSFTNGP10.phx.gbl...
> > > > > Sorry..

> > > > > I have 2 type of code :
> > > > > 1. Code that scans all contact folders for contact items &
> > distribution
> > > > > lists ..
> > > > > 2. Code that uses IAddrBook  &  IMAPISession*
> > psession->OpenAddressBook
> > > > > ...etc    for retrieving all AddressContainers & it's Content
table

> > > > > Code no.2 woks well & it's quick .. but the problem is  , as you
> said
> > ,
> > > > > can't get Mobile Number for a purticular entry  using IAddrBook ..

> > > > > Code no.1 works ...but the problem is :

> > > > > but any contact folder can have a distribution lists also ..
> > > (recursively
> > > > > distribution list can contain another d-lists ..)

> > > > > if i want to open a distribution list inside a folder ,
> > > > > you have suggested :

> > > > > " You can retrieve all the members of a distribution lists in the
> > > contacts
> > > > > folders
> > > > >  using the regular IMessage interface - entry ids of all the dist
> list
> > > > >  members
> > > > >  are stored in the named property with id = 0x8054 and GUID =
> > > > >  {00062004-0000-0000-C000-000000000046}. It is a PT_MV_BINARY
> > property,
> > > > > just  retrieve each element and call IAddrBook::OpenEntry() - you
> will
> > > get
> > > > > back
> > > > >  IMailUser of that member.  "

> > > > > So , even after i can open it , i will still have a problem of
> getting
> > > > Named
> > > > > proprety (mobile phone number) from it  because of IAddrBook ...

> > > > > I am kind of stuck ..and can't find a way around ... i am trying
as
> > much
> > > > as
> > > > > i can ..(past 4 days , 10 hours a day ..trying just to find out
> > solution
> > > > for
> > > > > this !)
> > > > > ( I don't see any reason , why there is very little documentation
> for
> > > > ExMAPI
> > > > > from Micro$oft ....)

> > > > > I should be able to get all contacts & their mobile numbers from
> > > > > outlook/exchange..
> > > > > (Contact folders + D-lists + Public folders + GALs + other address
> > lists
> > > > > ..etc..)

> > > > > Sorry again ..(if i wasted ur time ..)

> > > > > Thanks ....

> > > > > "Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message
> > > > > news:OnVjRzwRDHA.2148@TK2MSFTNGP10.phx.gbl...
> > > > > > 1. You need to work with the IPM.Contact messages directly in
the
> > > > Contacts
> > > > > > folder rather than going through IAddrBook
> > > > > > 2. You need to retrieve the corresponding named properties. Did
> you
> > > read
> > > > > my
> > > > > > reply to your previous question?

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

> > > > > > "Maulik Patel" <mau...@cylish.com> wrote in message
> > > > > > news:erzqXVvRDHA.2236@tk2msftngp13.phx.gbl...
> > > > > > > Dear Experts ,

> > > > > > > I am still facing 2 problems ...

> > > > > > > Problem 1:

> > > > > > > My Code , now retrieves all contacts from various address
> > containers
> > > > ...

> > > > > > > .........................

> > > > > > > IAddrBook->OpenEntry(...)

> > > > > > > ..

> > > > > > >  // Get the entryid of the root AddressBook container
> > > > > > >   hr = pAddrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL,
> > > > > > > 0,(ULONG*)&ulObjType,(LPUNKNOWN *)&lpContainer);

> > > > > > >   hr =
> lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);

> > > > > > > .............................
> > > > > > > etc..etc...

> > > > > > > But i have

...

read more »

 
 
 

Contacts from ExMAPI

Post by Maulik Pate » Sat, 12 Jul 2003 18:45:59


oops...

1 correction :

this also works,

     lpMailUser->GetProps(NULL, 0, &ulcValues, &lpPropArray); //get the
properties from the mail user.

     name_2="";
     if(lpPropArray) {
       LPSPropValue
lpspv=PpropFindProp(lpPropArray,ulcValues,PR_CELLULAR_TELEPHONE_NUMBER);
       if(lpspv) name_2=lpspv->Value.lpszA;
     }

"Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message

news:uxpdJwyRDHA.2408@TK2MSFTNGP10.phx.gbl...
> No, you need to call IMessage::GetIDsFromNames() passing the GUID and id
> (either a string or an integer).
> Look at the contact with OutlookSpy (select a contact, click IMessage
> button), select the property that holds the data you are after (it'll be
in
> the 0x8xxx form), look at the "Named Property" box on the right hand side.
> BTW, Outlook address book does not support named properties.

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

> "Maulik Patel" <mau...@cylish.com> wrote in message
> news:eh9liFyRDHA.2676@TK2MSFTNGP10.phx.gbl...
> > I am Very Very new to ExMAPI ... if i am doing sothing very stupid here
> > ...then please forgive me ...

> > do think , i should try GetIDsFromNames() stuff on IAddrBook entries ?

> > here is what i tried,

> > long uID1=-1;
> > GetIDForName(lpContainer,"PR_MOBILE_TELEPHONE_NUMBER",&uID1);

> > LPSPropValue sProp=NULL;
> > HrGetOneProp(lpContainer,uID1 | PT_TSTRING,&sProp);

> > HRESULT GetIDForName(IABContainer* pMsg, const char * szName, long *
plID)
> > {
> >     MAPINAMEID mid;
> >     mid.lpguid = (LPGUID)&PS_PUBLIC_STRINGS;
> >     mid.ulKind = MNID_STRING;
> >     char tb[256*2]; // ick!
> >     mid.Kind.lpwstrName = (wchar_t*)tb;

> >     MultiByteToWideChar((UINT)CP_ACP,
> >         (DWORD)0,
> >         szName,
> >         -1,
> >         (unsigned short *)tb, // ick!
> >         256);

> >     LPMAPINAMEID pmid = &mid;

> >     LPSPropTagArray ptaga = NULL;
> >     HRESULT hr = pMsg->GetIDsFromNames(1, &pmid,0, &ptaga);

> >     if (FAILED(hr))
> >     {
> >         return hr;
> >     }

> >     *plID = ptaga[0].aulPropTag[0];

> >     MAPIFreeBuffer(ptaga);

> >     return S_OK;
> > }

> > i know ,  pMsg should be of  IMessage*  type ...
> > But i want to get that named property from AddressBook Entry ...

> > also tried,

> >     LPSPropValue

lpspv=PpropFindProp(msrows3->aRow[i].lpProps,msrows3->aRow[i].cValues,PR_CEL

- Show quoted text -

> > LULAR_TELEPHONE_NUMBER);
> >     if(lpspv) name_2=lpspv->Value.lpszA;

> > Thanks.

> > "Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message
> > news:eR0tU7xRDHA.2480@tk2msftngp13.phx.gbl...
> > > How do you call GetIDsFromNames() to retrieve the phone # prop tag?

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

> > > "Maulik Patel" <mau...@cylish.com> wrote in message
> > > news:O6OC1exRDHA.1720@TK2MSFTNGP10.phx.gbl...
> > > > Sorry..

> > > > I have 2 type of code :
> > > > 1. Code that scans all contact folders for contact items &
> distribution
> > > > lists ..
> > > > 2. Code that uses IAddrBook  &  IMAPISession*
> psession->OpenAddressBook
> > > > ...etc    for retrieving all AddressContainers & it's Content table

> > > > Code no.2 woks well & it's quick .. but the problem is  , as you
said
> ,
> > > > can't get Mobile Number for a purticular entry  using IAddrBook ..

> > > > Code no.1 works ...but the problem is :

> > > > but any contact folder can have a distribution lists also ..
> > (recursively
> > > > distribution list can contain another d-lists ..)

> > > > if i want to open a distribution list inside a folder ,
> > > > you have suggested :

> > > > " You can retrieve all the members of a distribution lists in the
> > contacts
> > > > folders
> > > >  using the regular IMessage interface - entry ids of all the dist
list
> > > >  members
> > > >  are stored in the named property with id = 0x8054 and GUID =
> > > >  {00062004-0000-0000-C000-000000000046}. It is a PT_MV_BINARY
> property,
> > > > just  retrieve each element and call IAddrBook::OpenEntry() - you
will
> > get
> > > > back
> > > >  IMailUser of that member.  "

> > > > So , even after i can open it , i will still have a problem of
getting
> > > Named
> > > > proprety (mobile phone number) from it  because of IAddrBook ...

> > > > I am kind of stuck ..and can't find a way around ... i am trying as
> much
> > > as
> > > > i can ..(past 4 days , 10 hours a day ..trying just to find out
> solution
> > > for
> > > > this !)
> > > > ( I don't see any reason , why there is very little documentation
for
> > > ExMAPI
> > > > from Micro$oft ....)

> > > > I should be able to get all contacts & their mobile numbers from
> > > > outlook/exchange..
> > > > (Contact folders + D-lists + Public folders + GALs + other address
> lists
> > > > ..etc..)

> > > > Sorry again ..(if i wasted ur time ..)

> > > > Thanks ....

> > > > "Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message
> > > > news:OnVjRzwRDHA.2148@TK2MSFTNGP10.phx.gbl...
> > > > > 1. You need to work with the IPM.Contact messages directly in the
> > > Contacts
> > > > > folder rather than going through IAddrBook
> > > > > 2. You need to retrieve the corresponding named properties. Did
you
> > read
> > > > my
> > > > > reply to your previous question?

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

> > > > > "Maulik Patel" <mau...@cylish.com> wrote in message
> > > > > news:erzqXVvRDHA.2236@tk2msftngp13.phx.gbl...
> > > > > > Dear Experts ,

> > > > > > I am still facing 2 problems ...

> > > > > > Problem 1:

> > > > > > My Code , now retrieves all contacts from various address
> containers
> > > ...

> > > > > > .........................

> > > > > > IAddrBook->OpenEntry(...)

> > > > > > ..

> > > > > >  // Get the entryid of the root AddressBook container
> > > > > >   hr = pAddrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL,
> > > > > > 0,(ULONG*)&ulObjType,(LPUNKNOWN *)&lpContainer);

> > > > > >   hr =

lpContainer->GetContentsTable(MAPI_DEFERRED_ERRORS,&lpAB);

- Show quoted text -

> > > > > > .............................
> > > > > > etc..etc...

> > > > > > But i have noticed that ,  you cannot retrive a contact who
> doesn't
> > > have
> > > > a
> > > > > > email address ...
> > > > > > for me , email address  is not important  , since i only want to
> > > > retrieve
> > > > > > Mobile Phone Number ...
> > > > > > OutlookSpy also doesn't show those contacts ..(when clicking
from
> > > > > IAddrBook
> > > > > > CommandButton ..)

> > > > > > Is there any way to sepecify , "include all contact items ,,
even
> if
> > > > they
> > > > > > don't have an email address !"

> > > > > > Problem 2:

> > > > > > Can someone send me the code (sample!) , for retrieving a Named
> > > Property
> > > > > > from a contact item ?

> > > > > > PR_CELLULAR_TELEPHONE_NUMBER or PR_MOBILE_TELEPHONE_NUMBER

> > > > > > Thanks a lot ....

> > > > > > Sincerely ,

> > > > > > Maulik Patel