问题
I am currently trying to implement the Interop.MODI.dll (From Microsoft Office) to use the Image -> Text features it should Provide. But when doing
var modi = new MODI.DocumentClass();
I get:
"COMException 80040154 with CLSID {40942A6C-1520-4132-BDF8-BDC1F71F547B}".
What have I tried to solve that problem?
I registered the DLL using the regasm tool: -Problem still exists
I tried setting the BuildPlatform to x86: -Problem still exists
I use the Visual Studio 2010 Ultimate with Windows 7 Professional 64Bit & Have Microsoft Office 2007 installed
EDIT: I found the Solution:
I needed to install the "MS-Office-Document-Imaging" feature to MS Office to get it working. (Software -> MS Office (rightclick -> edit) -> Add Features -> Microsoft Office Document Imaging)
回答1:
Try to check if Microsoft Office Document Imaging Components
are installed correctly.
You can do that by modifying your Microsoft Office Installation
Software > Edit Microsoft Office Installation > Add/Remove Components
.
Be sure, that Office-Tools > Microsoft office Document Imaging
is installed completely!
Furthermore, if you are developing on a 64-bit machine, change your project output from any CPU
to x86
回答2:
Configure the IIS (Internet Information Server) Application Pool + properties + advanced configuration option to enable 32-bit applications to TRUE.
来源:https://stackoverflow.com/questions/8213894/using-interop-modi-throws-0x80040154-exception