Yep i think you were on to something there, i tried:
[code]
if(paragraph instanceof ListEntry)
{
System.out.println("true");
}
else
{
System.out.println("false");
}
[/code]
Which seemed to work, ill do some more research and see does a similar
solution work for all the tags i want.
Best
Mark
MSB wrote:
>
> I am hoping that it really is this simple but I cannot be too sure that it
> really will be. The org.apache.poi.hwpf.usermodel.Range class is the
> parent class for CharacterRun, DocumentPosition, Paragraph, Section, Table
> and TableCell, whilst Paragraph is the parent of ListEntry. I have never
> tried this but could it be as simple as using instanceof to test what
> class you actually had in hand whilst parsing the document? It should be
> easy enough to test this hypothesis;
>
> Open a document.
> Get the top level Range object.
> Get the number of Pargraphs.
> Iterate through the Paragraphs one at a time and test to see what object
> you actually have in hand.
>
> There are going to be one or two holes in this - I think that it will not
> deal with pictures for example - but it could well be a way to start.
>
> Yours
>
> Mark B
>
--
View this message in context:
http://old.nabble.com/Extract-Text-with-style-type-information-tp27209960p27275276.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]