title: COMException: A client operation failed Outlook
body: <p>in my Application I store different Folders EntryIDs (Emails, Contacts...) in order to select them at a later point.
  The problem is, sometimes I get a COMException: </p>
  
  <blockquote>
    <p><em>A client operation failed. (at
    Microsoft.Office.Interop.Outlook.NameSpaceClass.GetFolderFromID(String
    EntryIDFolder, Object EntryIDStore))</em></p>
  </blockquote>
  
  <p>Update:
  I got another error message at the same operation (without modifying the code)</p>
  
  <blockquote>
    <p><em>The messaging interface has returned an unknown error. If the problem persists, restart Outlook</em></p>
  </blockquote>
  
  <p>My code looks like:      </p>
  
  <pre><code>       outlookApp.Session.GetFolderFromID(searchFolder);
  </code></pre>
  
  <p>OutlookApp is defined and declared that way:</p>
  
  <pre><code> private ApplicationClass outlookApp;
  try
          {
              outlookApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();
          }
          catch (System.Exception)
          {
              try
              {
                  outlookApp = Activator.CreateInstance(Type.GetTypeFromProgID("Outlook.Application")) as Microsoft.Office.Interop.Outlook.ApplicationClass;
              }
              catch (System.Exception)
              {
                  outlookApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Outlook.Application") as Microsoft.Office.Interop.Outlook.ApplicationClass;
  
              }
          }
  </code></pre>
  
  <p>My suggestion is, that this is somehow connected to shared folders, but I am not able to reproduce the error on a regular basis.
  The Outlook is in Cache Mode. Exchange is throwing a lot of Sync Errors with Calendars, but I'm not working on them. 
  I cannot reproduce the error on a test vm with the users mailbox. I tried repairing with the internal tool from office (it found errors), but this did not fix anything either. </p>