C# 如何在visual studio中添加程序集DocumentFormat.OpenXml.Wordprocessin
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18480532/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to add assembly DocumentFormat.OpenXml.Wordprocessin in visual studio
提问by Aruni Godage
I want to read a doc file and do some operation and I found a code, but it has asking following "WordprocessingDocument" namespace.Has anyone know from where I can find this assembly.please dont sent me a download link for .dll file because it not good to add third party .dll directly.
我想阅读一个 doc 文件并做一些操作,我找到了一个代码,但它要求遵循“WordprocessingDocument”命名空间。有谁知道我可以从哪里找到这个程序集。请不要给我发送 .dll 文件的下载链接,因为直接添加第三方.dll 不好。
回答by Abbas
you can download "Open XML SDK 2.5 for Microsoft Office" from http://www.microsoft.com/en-us/download/details.aspx?id=30425
您可以从http://www.microsoft.com/en-us/download/details.aspx?id=30425下载“Open XML SDK 2.5 for Microsoft Office”
for using this lib go to http://msdn.microsoft.com/en-us/library/office/bb448854.aspx
要使用此库,请访问http://msdn.microsoft.com/en-us/library/office/bb448854.aspx
回答by vibs2006
As per recent updates and methods for adding any namespaces related to Open XML SDKplease add name spaces like System.IO.Packaging, DocumentFormat.OpenXmletc via Nuget Package. You can find nuget package on https://www.nuget.org/packages/DocumentFormat.OpenXml/
根据最近的更新和添加与Open XML SDK相关的任何命名空间的方法,请通过 Nuget Package添加命名空间,如System.IO.Packaging、DocumentFormat.OpenXml等。您可以在https://www.nuget.org/packages/DocumentFormat.OpenXml/上找到 nuget 包
To Install this Nuget Package you can open Nuget Package Mananger console (Tools-> Nuget Package Manager-> Nuget Package Manager Console)and make sure that you have right project selected in console dropdown.
要安装此 Nuget 包,您可以打开 Nuget 包管理器控制台(工具-> Nuget 包管理器-> Nuget 包管理器控制台)并确保在控制台下拉列表中选择了正确的项目。
Run the following command.
Install-Package DocumentFormat.OpenXml
运行以下命令。
Install-Package DocumentFormat.OpenXml
Alternatively you can also install it via Nuget Package Manager GUI which you can open simply by Right clicking on Solution Explorer and going in 'Manage Nuget Packages'
或者,您也可以通过 Nuget 包管理器 GUI 安装它,您只需右键单击解决方案资源管理器并进入“管理 Nuget 包”即可打开它