ToC update doesn't work
Posted: Fri Nov 18, 2016 2:02 am
Hi Jason,
I have added a Content Control around the Toc in the Word template.
But when executing the following code (Docx4j version 3.3.1)
I get this error:
Is this related to the fact that we don't use the professional version of Docx4J?
But if so, I would expect a "better" error message.
Or does this have another root cause? Perhaps the Toc in Word needs a binding?
Thanks,
Klaus
I have added a Content Control around the Toc in the Word template.
But when executing the following code (Docx4j version 3.3.1)
- Code: Select all
TocGenerator tocGenerator = new TocGenerator(wordMLPackage);
tocGenerator.updateToc(false, true);
I get this error:
org.docx4j.toc.TocException: No ToC content control found
at org.docx4j.toc.TocGenerator.updateToc(TocGenerator.java:494)
Is this related to the fact that we don't use the professional version of Docx4J?
But if so, I would expect a "better" error message.
Or does this have another root cause? Perhaps the Toc in Word needs a binding?
Thanks,
Klaus