Question

I would like to use NPOI library to get image from Word file (Doc [97-2003]).

I want to HWPFDocument class, but i can not find namespace, where this class is. I write code in c#.

Was it helpful?

Solution

I don't think you can achieve that using NPOI.
As tonyqus (the guy behind the project) states here and here HWPF is not stable and usable. I've managed to work with MS Word and Excel with "OpenOffice uno SDK".
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.

Hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top