Hi Rainer,
I got your point.... hwpf is really taking a toll on me :).....
if I create a new blank word document first and then want to copy something
into it , the same error comes until i put at least one character manually
in that document... And another problem i have come across is that my old
document has many tables and images in it and now if i say
doc.write(OutputStream) it shows the following error
java.lang.NullPointerException
at org.apache.poi.hwpf.model.ListLevel.toByteArray(ListLevel.java:227)
at
org.apache.poi.hwpf.model.ListTables.writeListDataTo(ListTables.java:129)
at org.apache.poi.hwpf.HWPFDocument.write(HWPFDocument.java:375)
at org.apache.poi.hwpf.QuickTest.main(QuickTest.java:169)
do i to need to copy images and tables explicitely? what to do for that....
beacause if i take one simple document without any image or table it does
fine...
best regards
turja
Rainer Schwarze wrote:
>
> 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/
>
>
>
--
View this message in context:
http://www.nabble.com/Need-to-set-style-of-a-character-paragraph-using-HWPF-tf3325890.html#a9325753
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
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/