My Word Template module does exactly what you need:
https://marketplace.mendix.com/link/component/111539
I also wrote a blog about it, that should give you a good idea of what it can do for you:
Hi Jack,
I just released version 5.1.0 of the Word Template demo project. Download it to get the new template (5.1.0) which is needed for demonstrating how this is done. You can see it in action at:
https://wordexporter127-sandbox.mxapps.io/index.html
In step 1 choose the new 5.1.0 template and either export to Word or PDF. I just tested it and it works. FYI; please check the configuration in step 8. Images and see how I transform the Picture object to a base64 encoded string that is handled in the same manner as the Rich Text Items.