title: Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE)) when running through Windows Service?
body: <p>i am try to hook to outlook application from windows Service but getting an exception Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))  here is my code.</p>
  
  <pre><code>   public void ItemSendEvent()
      {
          try
          {
             if (Process.GetProcessesByName(ApplicationConstants.OUTLOOK_PROCESS_NAME).Count() &gt; 0)
                  {
                      // If so, use the GetActiveObject method to obtain the process and cast it to an Application object.
                      outlookApplication = Marshal.GetActiveObject(ApplicationConstants.OUTLOOK_APPLICATION_NAME) as Microsoft.Office.Interop.Outlook.Application;
                      Microsoft.Office.Interop.Outlook.NameSpace nameSpace = outlookApplication.GetNamespace(ApplicationConstants.OUTLOOK_NAME_SPACE);
                      nameSpace.Logon("", "", Missing.Value, Missing.Value);
                      nameSpace = null;
                      outlookApplication.ItemSend += outlookApplication_ItemSend;
                  }
                  log.Info("Outlook Item Send event registered successfully.");
          }
          catch (System.Exception ex)
          {
              log.Error("Exception occurred while registering Outlook Item Send event. " + ex.Message);
          }
      }
  </code></pre>
  
  <p>but the same code when i launch it through Windows Form Application its working Fine. i gone through some site's and they were saying that outlook object is not in ROT Table. what will be the solution.</p>