At 06:18 05.03.2007, turjabarua wrote:
>
>Hi Rainer,
>             Might be the way i'm trying to generate a word document is
>wrong. But i'm really confused how to create a blank document first and add
>text, paragraph or whatever I want to that document. Now I'm trying 
>by using (default constructor)

You need to use a base document. HWPF does not yet support a creation of
empty documents from scratch.

>HWPFDocument doc1 = new HWPFDocument ();

Doesn't work - that constructor is actually empty and does nothing :-) (You
see, there are some issues which make it necessary, that HWPF is still in
the scratchpad :-) )

>I also tried using 
>
>HWPFDocument doc1 = new HWPFDocument (new POIFSFileSystem());

Doesn't work either, because HWPF expects to find real "Word content" with
that call.

>both the cases i'm gettign the same error!! ... And also i'm really clueless
>how to make that blank document first.

You can only take an empty document and open that. (Need not be a template
(DOT)) If you want to make your life a bit easier, you can define the
styles you need in that document so you can just apply them and do not need
to create them.

Best wishes,
Rainer


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

Reply via email to