How load an existing DOCX into TTMSFNCWXDocx

How can this be done?

tx Bernd


Unfortunately this is not possible with this component. This uses the Docx.js library underneath which only supports the creation of documents and not importing existing ones.

Any chance to convert an existing DOCX to JSON, as I can recreate the doc from JSON?

Unfortunately not. Hower you could create the document using the component and then export it using the following function:

TMSFNCWXDocx1.Document.SaveToJSONFile(GetCurrentDir + '/Template.JSON');

and load it back in using the following code:

TMSFNCWXDocx1.Document.LoadFromJSONFile(GetCurrentDir + '/Template.JSON');

This JSON File is specially constructed for the TTMSFNCWXDocx Component. It does require a certain structure for it in order to work.

You can find an example of this in the demo folder > docx > Advanced - JSON Templates.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.