title: Outlook.Application.CreateItem with Office365 says: The operation failed
body: <p>We've written an Outlook plugin using Add-in-Express.  Code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>private void CreateShowMessageUsingCreateItem(Outlook._Application OutlookApp) 
  { 
      Outlook.MailItem mail = null; 
      try 
      { 
          mail = OutlookApp.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem; 
          mail.Save(); 
          mail.Display(false); 
      } 
      catch (Exception ex) 
      { 
          System.Windows.Forms.MessageBox.Show(ex.Message); 
      } 
      finally 
      { 
          if (mail != null) Marshal.ReleaseComObject(mail); 
      } 
  } 
  </code></pre>
  
  <p>Works when Outlook is connected to Exchange. Fails when
  Outlook is connected to Office365.  Error:</p>
  
  <pre><code>Exception: System.Runtime.InteropServices.COMException (0x80004005): The operation failed.
     at Microsoft.Office.Interop.Outlook.ApplicationClass.CreateItem(OlItemType ItemType)
     at DocuSignInk.DSToolbox.ShowResponse(MailItem senderEmail) in C:\docusign_source\Ink_Outlook\DocuSignInk\DSToolbox.cs:line 540
  </code></pre>
  
  <p>Some research indicates that you need to release your objects
  when making these calls in a loop.  But I'm not in a loop. I
  can't even get one call to work, so I don't get to the point
  where I can release anything.</p>
  
  <p>Testing with Wireshark and Charles indicates that the problem is
  in the client.  I was trying to see if there is a more detailed
  error coming from the server, but there's no traffic to the server
  at all.</p>
  
  <p>A quick Python script works from the command line.</p>
  
  <pre><code>import win32com.client
  
  outlook = win32com.client.Dispatch('Outlook.Application')
  mail = outlook.CreateItem(win32com.client.constants.olMailItem)
  mail.Save()
  mail.Display(False)
  </code></pre>
  
  <p>So it must be something in the client. I'm guessing maybe thread-related?</p>