解决 interop.word 外部组件异常
来源:互联网 发布:编程猫软件下载 编辑:程序博客网 时间:2024/06/08 12:06
http://www.cnblogs.com/hbb0b0/articles/1880490.html
未处理 System.Runtime.InteropServices.SEHException
Message="外部组件发生异常。"
Source="Interop.Word"
ErrorCode=-2147467259
StackTrace:
在 Word.Find.set_Text(String prop)
在 TPRI.Common.IOLibrary.OperatorWord.ReplaceText(String replaceText, String valueText) 位置 C:\Documents and Settings\lhb\My Documents\Reflector\Disassembler\TPRI.Common\TPRI\Common\IOLibrary\OperatorWord.cs:行号 108
在 ConsoleApplication1.Program.Main(String[] args) 位置 C:\Documents and Settings\lhb\My Documents\Reflector\Disassembler\ConsoleApplication1\Program.cs:行号 17
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
调用word组件产生以上错错误。
原因:word的注册的组件库损坏,需要重新注册word组件库
解决方法:
然后,在命令行中将 Regtlib.exe 与类型库的完整路径一起使用以向 COM 重新注册该库。Regtlib.exe 将在传入的类型库(.tlb 或 .olb)文件上调用 LoadTypeLib 和 RegisterTypeLib 应用程序接口 (API)。COM 会修复错误配置的注册表项。
Regtlib.exe "C:\Program Files\Microsoft Office\Office12\MSWORD.OLB"(注意:英文的双引号不是单引号),如果没有Regtlib.exe ,可以到C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regtlibv12.exe 目录下执行
regtlibv12.exe "C:\Program Files\Microsoft Office\Office12\MSWORD.OLB". regtlibv12.exe 为 Regtlib.exe升级版
- 解决 interop.word 外部组件异常
- 解决 interop.word 外部组件异常
- C#生成word时发生“外部组件发生异常”
- 针对C#操作Word时提示:外部组件发生异常问题
- 解决引用Microsoft.Office.Core 和Microsoft.Office.Interop.Word
- C#操作Word导致 “Microsoft.Office.Interop.Word.ApplicationClass”的 COM 组件错误的解决方法
- Interop统计WORD字数
- 解决引用Microsoft.Office.Core和Microsoft.Office.Interop.Word 的问题
- 关于读word中table出现“无法将带 [] 的索引应用于“Interop.Word.Tables”错误的解决
- Microsoft.Office.Interop.Word 创建word
- Microsoft.Office.Interop.Word 创建word
- Word转Html ( Microsoft.Office.Interop.Word )
- Microsoft.Office.Interop.Word 创建word
- C# 外部组件发生异常原因分析 [分析]
- ASP.NET 中的“外部组件发生异常”信息
- visual studio 2012 打开 accdb 数据库 外部组件异常
- 外部组件发生异常 无效的短文件名
- 关于Microsoft.Office.Interop.Word类库
- 做更好的自己:不值得你去做的30件事
- DEVICE_ATTR 和 sysfs 的东西 -- sysfs_create_group
- google的提供的语音到text的服务
- Java判断字符串是否为空
- UIAppearance Protocol Reference
- 解决 interop.word 外部组件异常
- EXCEL中将多个单元格内容合并到一个单元格中的方法(转帖+亲自实践)
- 嵌入chrome进入你的程序
- Openssl aes对称加密算法 加解密例程 1
- Access sql语句
- java学习——java中的时间处理
- javascript函数(二)--将函数作为参数传递
- 下拉菜单内容自动更新的技巧(转帖+亲自实践)
- 苹果醒醒吧 封杀解决不了问题