简体   繁体   English

MS Word,使用NPOI库

[英]MS Word, using NPOI library

I would like to use NPOI library to get image from Word file (Doc [97-2003]). 我想使用NPOI库从Word文件中获取图像(文档[97-2003])。

I want to HWPFDocument class, but i can not find namespace, where this class is. 我想使用HWPFDocument类,但是找不到此类所在的名称空间。 I write code in c#. 我用C#编写代码。

I don't think you can achieve that using NPOI. 我认为您无法使用NPOI实现这一目标。
As tonyqus (the guy behind the project) states here and here HWPF is not stable and usable. 作为tonyqus(项目背后的家伙)指出这里这里 HWPF是不是稳定和可用。 I've managed to work with MS Word and Excel with " OpenOffice uno SDK ". 我设法通过“ OpenOffice uno SDK ”使用MS Word和Excel。
It's not straightforward but after a little bit of struggle you can have great results. 这并不简单,但是经过一些努力,您可以取得不错的结果。
You can read how to extract and use the assemblies here and how to achieve what you're looking for here . 你可以阅读如何提取和使用的组件在这里 ,以及如何实现你在找什么在这里

Of course you can always use MSOffice Interop but you need to install MS Office on the client where the application is executed. 当然,您始终可以使用MSOffice Interop,但是您需要在执行该应用程序的客户端上安装MS Office。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM