The background colour of the paragraph, now I do not know if that is acessible. The best place to start looking would be with the paragraph style. Having said that, here goes, from the Paragraph object, you can get the style index by calling the getStyleIndex() method. From the HWPFDocument object, it should be possible to get the StyleSheet by calling the getStyleSheet() method of that object. On the StyleSheet object, you can call the getParagraphStyle(int) method and pass the value returned from the original call to the getStyleIndex() method. That will return to you an instance of the ParagarphProperties class that you can then interrogate. It contains methods that will give you information about the Paragraph itself but I am not so certain that will give you the background colour of the paragraph - even though it does contain a method called getShading() and I am not at all sure what that does.
There is also a CharacterProperties class. Again, it is accessible from the StyleSheet object and it does contain methods called isHighlighted() and even setHighlighted(). Sadly though I cannot see any method that allows you to get at the colour of the highlight if the text is highlighted. There is a getColor() method but I suspect that all that does is return the index of the colour for the character(s) rather than the background. Many of these same methods are accessible from the CharacterRun class and I would expect that HWPF will create CharacterRun objects for the un-highlighted and highlighted portions of the paragraph of text. All the best because I have never done anything like this myself and the above is all conjecture based on working through the javadocs - and let us know if you make any progress. HWPF is an immature api that is need of good developers - hint - and if you intend to do a lot of work with it, perhaps you could consider becoming involved in pushing the project forward. Yours Mark B -- View this message in context: http://apache-poi.1045710.n5.nabble.com/HWPF-Paragraph-Table-colors-tp4286210p4286795.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]
