You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by anoob <an...@rediffmail.com> on 2006/06/26 08:00:33 UTC

Doubt regarding Word2003 manipulation using POI

 
  
Hi,
	I am very new to POI.
	My requirement is to access all the contents of a particular word File and modify the contents and put them back. When i am trying to  modify the Word file thru HWPFFileSystem and then try to set it back thru getStrem i am getting a null value. Can any one help me out how to resolve this issue.

Regards
 Anoob 

Re: Doubt regarding Word2003 manipulation using POI

Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 26 Jun 2006, anoob wrote:
> My requirement is to access all the contents of a particular word 
> File and modify the contents and put them back. When i am trying to 
> modify the Word file thru HWPFFileSystem and then try to set it back thru 
> getStrem i am getting a null value. Can any one help me out how to 
> resolve this issue.

Unfortunately, there are known to be a few bugs in the HWPF change+write 
support. Alas, Ryan Ackley didn't get to fix them all before he left the 
project, so it is possible that you won't be able to do everything you 
hoped to.

With that in mind, patches to improve hwpf are gratefully received!


With regard to your problem, you should probably be using HWPFDocument. It 
provides a much nicer interface than HWPFFileSystem.

Just give an input stream to HWPFDocument, find the ranges / character 
runs / paragraphs of interest, change them, then use
doc.write(OutputStream) when you're done

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/