Error: System.InvalidCastException: Could not cast COM object of type "Microsoft.Office.Interop.Word.ApplicationClass" to interface type " Microsoft.office.interop.word._application ". This operation failed because of a COM component call to an interface with IID ' {00020970-0000-0000-c000-000000000046} ' QueryInterface failed because of an error loading the type library/dll. (Exceptions are from HRESULT:0X80029C4A (type_e_cantloadlibrary)).
In System.StubHelpers.StubHelpers.GetCOMIPFromRCW (Object objsrc, IntPtr pcpcmd, intptr& pptarget, boolean& Pfneedsrelease)
In Microsoft.Office.Interop.Word.ApplicationClass.get_Selection ()
In BIMTClassLibrary.QuotationIndex.WriteContent ()
Cause: Previously installed WPS later uninstalled, WPS will modify the registry related to office unknown related items, causing the VSTO add-in error;
Solution: Locate the Office installation package selection fix to resolve;
System.InvalidCastException: Cannot cast COM object of type "Microsoft.Office.Interop.Word.ApplicationClass" to interface type " Microsoft.office.interop.word._application ".