title: How to remove UserProperty with Outlook Interop?
body: <p>I've run the following code to add a particular UserProperty of type <code>olText</code>:</p>
  <pre><code>mailItem.UserProperties.Add(Name: &quot;MyProperty&quot;, Type: OlUserPropertyType.olText);
  </code></pre>
  <p>I decided I wanted to use integer for the type instead, and changed my code to:</p>
  <pre><code>mailItem.UserProperties.Add(Name: &quot;MyProperty&quot;, Type: OlUserPropertyType.olInteger);
  </code></pre>
  <p>This, however, gives me a <code>COMException</code> stating that the property name already exists, but with a different type. I was not even aware that user properties would persist after shutting down my application. Now I can't seem to get rid of it!</p>
  <p>I've tried as suggested <a href="https://stackoverflow.com/a/8241185/12676067">here</a>, but when I try to retrieve the <code>UserProperty</code> with <code>mailItem.UserProperties[&quot;MyProperty&quot;]</code> I get <code>null</code>.</p>
  <p>How can I get completely rid of the user properties that I've added? How do I even see them?</p>