title: How to get Outlook contact groups using MAPI?
body: <p>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:</p>
  
  <pre><code>var outlook = new Outlook.Application().GetNamespace("MAPI");
  var folder = outlook.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
  foreach (var curr in folder.Items.OfType&lt;Outlook.ContactItem&gt;())
  {
      ...
  }
  </code></pre>
  
  <p>I <strong>do not</strong> mean default contact folders, such as "Contacts" and "Suggested contacts".</p>