Hello,
I'm using the component to manipulate an existing Word template. I've added placeholders in the document where I plan to replace them with data from our application, but even with a simple placeholder replace action I see I have errors when trying to open the generated document.
I've followed the exact steps from the Demo app, but for example for a very simple document manually created by me the actions work fine, but working with our company template seems to be causing some issues. Unfortunately I cannot share that exact document, maybe I'll try to anonymize/scramble the data if needed, but are there any known limitations in using this component for Word documents? (like having images/tables/formatted sections etc?). See below the error I'm receiving when trying to open the output doc:
Regards,
Bogdan
Hi Bogdan,
My best guess is that it might be related with having anchored images on your template, as this has been reported in the past:
https://www.outsystems.com/forums/discussion/44644/officeutils-image-inside-word-template-doesnt-work/
Bruno
Thanks Bruno,
Didn't know about it, was not brought up in my searches, but most likely it's same problem in my case since the template has quite some images already.
I will see if there's a solution of having those images in the template, I will have to check in more detail the anchoring part.
Unfortunatelly, if that is the issue, there is nothing we can do in the OfficeUtils implementation to solve it. As it is an issue of the underlying library (NPOI).
In the past I helped another community member fixing a Word template that had anchored images on the header and footer. At the time we removed the anchors, and used borderless tables to achieve the same content positioning.
Hope this information helps.
Best,
A few days ago a new version of NPOI was made available (2.7.1), which improves the support for image wrapping.
I have tested a template with an anchored image that used to result in a corrupted output file, and concluded that with this new NPOI version the file does not get corrupted anymore.
I have published a new version of OfficeUtils (5.0.9) which uses this new NPOI version.
It would be great if you could test your problematic template with this new version, and let me know if this resolves your issue. You do not need to do any replacement operations for testing this. A simple export based on your template is sufficient.