Hi,
I would like to share a solution to an issue I had, just to hear what you think about it. The challenge is: to create hyperlinks in a Word document.
FME allows you, with the use of MSWordStyler transformers, to create a Word document in a very versatile and easy manner. These transformers, however, do not allow you to insert hyperlinks into the doc.
Please see the attached zip file hyperlinks-to-word-python-docx.zip for a workflow where the document is created using MSWordStylers, followed by some post-processing with a PythonCaller to insert the hyperlinks: POIs with a link to Google Maps, in this case.
No, I did not write all of the Python script myself, hell, no! I used some existing bits and pieces and tweaked them a little bit to get the job done.
The add_hyperlink function was found on github and the docx_find_replace_text one on stackoverflow and I only modified them slightly to work together to replace my search text, the POI name, with a clickable hyperlink. More than 150 lines of code... but it gets the job done.
What do you think? Any comments and test results are appreciated.
Cheers,
Egge-Jan
Edit 2024-04-05: just noted today that the attachment to this post has disappeared with the transfer to the new community environment. I have added it again, this time in a zip file.