Hello Jason,
I would like to know if it is possible while adding a paragraph to a docx, add also a comment to a specific word within the paragraph.
Could you please help me with that?
Thank you,
MariaJ
It is currently Mon Aug 03, 2026 7:10 pm
News of ForumsFile templateZip = new File("resources/doctest.docx")
WordprocessingMLPackage template = WordprocessingMLPackage.load(templateZip)
def map = ["pagebreak": "<w:r><w:br w:type=\"page\"/></w:r>"]
template.mainDocumentPart.variableReplace(map)if (template.isGenerateToc()) {
Toc.setTocHeadingText("Inhaltsverzeichnis");
TocGenerator tocGenerator = new TocGenerator(wordPackage);
tocGenerator.generateToc(2, " TOC \\o \"1-3\" \\h \\z \\u ", true);
}
Total posts 10234 • Total topics 2888 • Total members 2109