使用C#读取word文档 [英] Reading a word document using C#
问题描述
错误2无法嵌入Interop类型Microsoft.Office.Interop.Word.ApplicationClass。请改用适用的界面。 C:\Projects \EmployeSoftwareProject\EmployeSoftwareProject\Retrivewordfile.cs 49 100 EmployeSoftwareProject
错误1类型'Microsoft.Office.Interop.Word.ApplicationClass'没有定义构造函数C:\ Projects\EmployeSoftwareProject\EmployeSoftwareProject\Retrivewordfile.cs 49 66 EmployeSoftwareProject
i实施使用C#读取word文档我遇到上述错误任何一个帮助错误。 。
Error 2 Interop type 'Microsoft.Office.Interop.Word.ApplicationClass' cannot be embedded. Use the applicable interface instead. C:\Projects\EmployeSoftwareProject\EmployeSoftwareProject\Retrivewordfile.cs 49 100 EmployeSoftwareProject
Error 1 The type 'Microsoft.Office.Interop.Word.ApplicationClass' has no constructors defined C:\Projects\EmployeSoftwareProject\EmployeSoftwareProject\Retrivewordfile.cs 49 66 EmployeSoftwareProject
i have implementing Reading a word document using C# i got above errors any one help what am wrong..
推荐答案
希望这会有所帮助。
http://msdn.microsoft.com/en-us/library/microsoft.office.interop。字%28v = office.11%29.aspx [ ^ ]
Hope This helps.
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word%28v=office.11%29.aspx[^]
您好,
这个错误通常会发生rs如果您尝试创建Microsoft.Office.Interop.Word.ApplicationClass
类的对象。所以,而是创建ApplicationCLass
的对象,创建应用程序
的对象,即Microsoft.Office.Interop.Word.Application
。
Hi,
this error generally occurs if you are trying to create object of"Microsoft.Office.Interop.Word.ApplicationClass"
class. so, rather creating object ofApplicationCLass
, create object of"Application"
, i.e,"Microsoft.Office.Interop.Word.Application"
.
//Example
Microsoft.Office.Interop.Word.Application Doc = new Microsoft.Office.Interop.Word.Application();
应用程序界面 [ ^ ]
Microsoft.Office.Interop.Word命名空间 [ ^ ]
希望它有所帮助。
Application Interface[^]
Microsoft.Office.Interop.Word Namespace[^]
hope it helps.
关于错误类型2.
请检查调用的dll属性是否Embedd Interop更改为false。
About the error type 2.
Please check if the invoked dll property "Embedd Interop" is changed as "false".
这篇关于使用C#读取word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!