Http://www.cnblogs.com/hbb0b0/articles/1880490.html
System. runtime. interopservices. sehexception not processed
Message = "external component exception. "
Source = "InterOP. Word"
Errorcode =-2147467259
Stacktrace:
In word. Find. set_text (string prop)
In tpri. common. iolibrary. operatorword. replacetext (string replacetext, string valuetext) Location C: \ Documents ents and Settings \ LHB \ My Documents ents \ reflector \ disassembler \ tpri. common \ tpri \ common \ iolibrary \ operatorword. CS: Row 108
In leleapplication1.program. Main (string [] ARGs) Location C: \ Documents ents and Settings \ LHB \ My Documents ents \ reflector \ disassembler \ consoleapplication1 \ Program. CS: Row 17
In system. appdomain. _ nexecuteassembly (Assembly, string [] ARGs)
In system. appdomain. executeassembly (string assemblyfile, evidence assemblysecurity, string [] ARGs)
In Microsoft. visualstudio. hostingprocess. hostproc. runusersassembly ()
In system. Threading. threadhelper. threadstart_context (object state)
In system. Threading. executioncontext. Run (executioncontext, contextcallback callback, object state)
In system. Threading. threadhelper. threadstart ()
Innerexception:
The above error occurs when you call the word component.
Cause: the component library registered with word is damaged. You need to re-register the word component library.
Solution:
Then, use regtlib.exe with the full path of the Type Library in the command line to re-register the library with COM. Regtlib.exe calls the loadtypelib and registertypelib application interfaces (APIS) on the passed-in Type Library (. TLB or. olb) file ). Com will fix the incorrect registry key.
Regtlib.exe "C: \ Program Files \ Microsoft Office \ office12 \ MSWord. olb "(Note: English dual-index numbers are not single-index numbers. If regtlib.exe is not available, go to c: \ windows \ Microsoft. net \ framework \ v2.0.50727 \ regtlibv12.exe directory
Regtlibv12.exe "C: \ Program Files \ Microsoft Office \ office12 \ MSWord. olb". regtlibv12.exe is upgraded to regtlib.exe