I'm currently deploying docx4j library to generate MS-Word and PDF documents from a .dotx document created with MS Office. Now I'm facing an issue that it loses all style formattings inside the paragraph if it contains "MERGEFIELD" placeholder.
The following is the sample dotx file before processing with MailMerger class:
<w:p w:rsidR="00FD281F" w:rsidRPr="00681127" w:rsidRDefault="00A26E2F" w:rsidP="002379F5">
<w:pPr>
<w:jc w:val="center" />
</w:pPr>
<w:r w:rsidRPr="00681127">
<w:t xml:space="preserve">No: </w:t>
</w:r>
<w:fldSimple w:instr=" MERGEFIELD No \* MERGEFORMAT ">
<w:r w:rsidR="00E111B1"> ...