We wrote a script to generate dynamically a template with a table including tags to replace.
And then in a second time the script created another document with the previously created template and replaced the tags with the function addTemplateVariable that accepts HTML content.
Unfortunately, when we open the final document, Word says that the document is corrupted. It comes from the template dynamically generated. We replaced the template by a template created manually and the problem disappears.
The second point is that the template mechanism can't solve our problem because after some tries I think a template can be add only once in a document.
As we want to generate a document with several tables with different numbers of rows for each ones, it seems the only one solution is that the function addElement could accept HTML content and this element could be added to an array of values in a table.
Could you confirm ?