contacts : distribution list

  • Thread starter Thread starter zzozo
  • Start date Start date
Z

zzozo

Hi, all.

My addin is trying to retrieve lastname and firstname from contacts
folder like contact.lastname + contact.firstname. However, if the
contact is a 'distribution list', the addin dies without throwing any
exception. Is there any way to make difference between regular contact
and distribution list?

Thanks in advance,
Seungchan
 
Thanks, Iv!

Could you take a look at my test code, and tell me what to do to
distinguish regulart contact and distributionList at <<< >>>? (By
the way, I am testing with outlook 2000.)



NameSpace objNS = applicationObject.GetNamespace("MAPI");
MAPIFolder contacts =
objNS.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
ContactItem c;

MessageBox.Show("" + contacts.Items.Count);

for ( int i=1; i<= contacts.Items.Count; i++ )
{
c = (ContactItem)contacts.Items.Item(i);

<<<<< if ( c.Class == OlItemType.olDistributionListItem ) >>>>>>>
{
MessageBox.Show("Caught distribution item!");
}
else
{
MessageBox.Show(c.FirstName + " " + c.LastName);
}
}


Thank you very much!
Seungchan
 
Back
Top