Closed Mtokoniewski closed 2 months ago
can you provide a sample docx and the python code you are using to replicate the problem ?
Here is a test I made, and it works perfectly, as supposed.
def test_multisection(self):
document, root_elem = self.merge_templates(
"test_multisection.docx",
[{"sec1": "v1", "sec2": "v2"}, {"sec1": "v3", "sec2": "v4"}],
separator="continuous_section",
output="tests/test_output_multisection.docx",
)
Mail Merging.zip Here is my attempt, fitted with Desired Output.
Hi, if you have sections, you should use exclusively section seaparators. So replace the page_break with nextPage_section and it will work.
Let me know if it works, and in this case, please close the issue.
Hey! Issue Solved, it worked.
Hey! I have a file that has merge fields separated from each other by continuous section break. I am looking for the option to select entire document as a template, rather than a single section.
Expected Behavior
I hoped that on printing merge fields, all mergefields within the document would become printed, meaning that I could merge them without changing formatting.
Current Behavior
Currently, only mergefields in the earliest document section are being read.
Possible Solution
Would it be possible to make the docx-mailmerge read entire document as template, even if the document originally contains multiple sections?