COM error in outlook
Hello,
I was trying to automate an outlook popup using the windows adapter. The solution worked perfectly in Dev box but when deployed on Prod getting the below exception. Any thoughts please.
Extra Msg: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook._MailItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063034-0000-0000-C000-000000000046}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).
at Microsoft.Office.Interop.Outlook._MailItem.Close(OlInspectorClose SaveMode)
at OpenSpan.Office.MicrosoftOutlookMail.ReleaseOfficeInstance()
at OpenSpan.Office.MicrosoftOutlookMail.New()
Thanks,
Madhu
***Moderator Edit: Vidyaranjan | Updated Categories***