python-docx-template
python-docx-template copied to clipboard
Shapes in a for loop
If the template document has a shape or text box in a for loop, whether it is inline or not, the rendered document will appear as corrupted. Word seems to be able to repair the document, and the shape is duplicated by the loop as expected once that happens.
I have only tested this on Word v16.42 for Mac OS, in case this happens to be specific to certain versions of Word.
I think the reason is that for-loops create duplicate object IDs. There is no plan to renumber such objects in docxtpl. Tagging this issue as enhancement.