Skip to main content

I've realized that we can include a template to MS-Word writer (docx). However it seems it only captures formatting from the template.

 

Is there any way that I can populate specific Bookmarks/Content Controls based on their title/tag names with attributes?

Hi @canerakin​ 

The Microsoft Word writer does not have this functionality natively.

Since you are working with .docx files and this format is part of Open Office XML, it should be possible to unzip the .docx file and directly manipulate the XML files contained within the zip. The folders and files should be zipped afterwards.

I've included an example workspace of this method and I hope it helps.


Hi @canerakin​ 

The Microsoft Word writer does not have this functionality natively.

Since you are working with .docx files and this format is part of Open Office XML, it should be possible to unzip the .docx file and directly manipulate the XML files contained within the zip. The folders and files should be zipped afterwards.

I've included an example workspace of this method and I hope it helps.

Hi Debbie,

Thanks a lot for this example. I've actually prepared a python script with docxtpl library. However I feel like your example can be more sustainable in the long run. Appreciated!


Reply