You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@PaulTerrasi this is fixed in docform, the maintained fork of python-docx-template. Copies of a shape or text box made by a loop now get unique anchorId, VML shape id and o:spid values, which were the duplicates behind the repair prompt (cvas22/docform#209).
Activity
elapouya commentedon Nov 16, 2020
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.
cvas22 commentedon Nov 25, 2026
@PaulTerrasi this is fixed in docform, the maintained fork of python-docx-template. Copies of a shape or text box made by a loop now get unique anchorId, VML shape id and o:spid values, which were the duplicates behind the repair prompt (cvas22/docform#209).