Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Better method to insert data into Word
Message
De
12/09/2019 14:09:03
 
 
À
12/09/2019 11:46:03
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01670760
Message ID:
01670798
Vues:
47
>>If these are DOCX document types, then these are XML files within a ZIP file (the DOCX file is actually a ZIP file). You can extract the XML and do direct replacement and completely stop the automation approach.
>
>well, that would be interesting (although a fair bit of work) - one process that has worked flawlessly with Adobe is to insert data into Adobe's .xfdf format, which is an xml file format (tried to show below but gave me grief). It never fails to load (unlike Word). But it is worth considering - just probably a lot of code to create the document from the template, save it progamatically, unzip it, do all that jazz - any idea if anyone has published any code showing this?

Vilhelm-Ion Praisach created a PRG based program that will create a DOCX file from table data. You could look at his code for ideas. I would expect that the XML would contain the text and you could do a STRTRAN() on the text. Instead of using bookmarks, you could use [[TEXTBLOCK1]] coded text block for the replacement positions within the text. This way you would not have to work with the OOXML as pointed out by Cetin. You could then extract the files, get the appropriate XML, replace the coded text, and then resave to the DOCX.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform