title: System.Runtime.InteropServices.COMException (0x80030020): The operation failed
body: <p>I'm trying to save a <code>Outlook.MailItem</code> to a folder using:</p>
  
  <p><code>MailItem.SaveAs(path, Outlook.OlSaveAsType.olMSG)</code></p>
  
  <p>This works fine most of the time. However, when there's about 20 emails hitting Outlook at once, for a few of the I get the following exception:</p>
  
  <pre><code>System.Runtime.InteropServices.COMException (0x80030020): The operation failed.
     at Microsoft.Office.Interop.Outlook._MailItem.SaveAs(String Path, Object Type)
  </code></pre>
  
  <p>I checked the code <code>0x80030020</code> which seems to mean "A share violation has occurred." However, I'm not sure what it means. In my application, I have the two below lines where the first one saves the email to a folder and the second method trying to POST that file to an API:</p>
  
  <pre><code>file = MailItemHelper.SaveMailItemToOFEFolder(mailItem);
  bool isEmailSentByHttp = MailItemHelper.SendMailItemToOFEApi(_userid, file)
  </code></pre>
  
  <p>The path has the subject of the email which is cleaned to remove non-alpha-numeric characters by doing:</p>
  
  <pre><code>Regex nonAlphaNumericRgx = new Regex(@"\W|_");
  subject = nonAlphaNumericRgx.Replace(mail.Subject, "_");
  </code></pre>