Version 3.9
OpenXML Word Documents.
Using createTOC will raise an exception if any of your styles are less than
7 characters. This is caused by the method createTOC and the line
if (parStyle != null && parStyle.substring(0,
7).equals("Heading")) {
Quick fix is to extend this class and override createTOC. The line should be
something like
if (parStyle != null && parStyle.startsWith("Heading")) {
Also remember to position to the location you want the TOC to be inserted.
My first post so I wasn't sure where to post.
Hope this helps someone.
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/XWPFDocument-createTOC-tp5713176.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]