In Outlook 2010, you can create contacts and add them to groups. Is there any way to get the list of such groups and the contacts in them? Here’s how I access the contacts:
var outlook = new Outlook.Application().GetNamespace("MAPI");
var folder = outlook.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
foreach (var curr in folder.Items.OfType<Outlook.ContactItem>())
{
...
}
I do not mean default contact folders, such as “Contacts” and “Suggested contacts”.
The contact groups are represented by DistListItem Interface.
DistListIteminterface hasMemberCountproperty andGetMember()method to iterate through the group members.