title: Iterate through a contacts properties using outlook
body: <p>I want to iterate through a contacts properties and add those that contain the word &quot;Number&quot; to a list with the value, i tries using reflection but it doesn't work.</p>
  <pre><code>using System;
  using System.Collections;
  using System.Collections.Generic;
  using System.Reflection;
  using Microsoft.Office.Interop.Outlook;
  
  namespace DuplicateNumbers
  {
      public class ContactService
      {
          public ContactItem Contact { get; private set; }
  
          private IDictionary&lt;string,string&gt; phoneNumbers = new Dictionary&lt;string, string&gt;();
  
          public ContactService(ContactItem contact)
          {
              Contact = contact;
          }
  
          public IDictionary&lt;string,string&gt; PhoneNumbers
          {
              get
              {
                  if(phoneNumbers.Count == 0)
                  {
                      PopulatePhoneNumbers();
                  }
                  return phoneNumbers;
              }
          }
  
          private void PopulatePhoneNumbers()
          {
              _ContactItem ci = Contact as _ContactItem;
              MemberInfo[] members = ci.GetType().FindMembers(MemberTypes.All, BindingFlags.Instance, (m,criteria) =&gt; true, null);
              foreach (var info in members)
              {
                  if(info.Name.Contains(&quot;Number&quot;))
                  {
                      phoneNumbers.Add(info.Name,info.Value);
                  }
                  Console.WriteLine(info);
              }
          }
      }
  }
  </code></pre>