Your code should work, Do me a favor and post it as a bug with the Word
document attached and I will look at it tonight.
Thanks
Ryan
----- Original Message -----
From: "Alexandru, Ionita" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 07, 2004 12:41 PM
Subject: Example
> can someone tell me where can I find some read/write word documents
> samples?
>
> I have to insert some text in a word document, after a specified
> sequence of known text.
> I've tried some code, but, the final word doc was corrupted
>
>
> ========================================================================
> ======
>
> public static void main(String[] args){
> try
> {
> HWPFDocument doc = new HWPFDocument (new FileInputStream
> (args[0]));
> Range r = doc.getRange();
>
> r.insertAfter("this is the text that I wanna insert");
> OutputStream out = new FileOutputStream(args[1]);
> doc.write(out);
>
> out.flush();
> out.close();
> }
> catch (Throwable t){
> t.printStackTrace();
> }
> }
>
>
>
>
>
>
>
>
> ========================================================================
> =========
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]