Information générale
Catégorie:
COM/DCOM et OLE Automation
>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement