Replacing all images in a document with numbered files
I am having an issue with the following:
I am importing Word documents into various other software tools. One of these tools has issues with several of the formats Words stores its figures, and will not import all of them properly (and Word import is the only import option). The workaround so far has been to use the Word Cleaner tool to extract all figures as .png files (they are in essence just screenshots of the figures), and then manually replace these. I am looking for a way to automate the process. I have started writing a script that goes through each image, but I am at a loss on how to actually replace the figure in question with a figure from an external file. Word Cleaner creates the .png files with filenames "word-filename.001.png", "word-filename.002.png" etc., so having a procedure for the actual replacing, doing it for the entire document shouldn't be a big problem. I'm just at a loss on how to get that (rather essential...) part of the script working. Any ideas on how to start would be most welcome!
I'm using Word 2016 32 bits btw.
|