2

I have a Word document with a large number of embedded images. To make version control easier I would like to save the document as XML and store all images separately (linked).

In the docx format the images are stored separately inside the zip, but I have not yet found a way to use those files uncompressed.

2 Answers 2

1

I have extracted the files from .docx (by renaming it to .zip). Then I saved my document as Word XML and in a text editor I've removed the <pkg:package> elements containing the binary data of the images and added the tag TargetMode="External" to the <Relationship> elements. Adding the TargetMode was quite easy using a search & replace because all images were named media/image....

After that I discovered that .gif files were saved as .png in the docx, so I had to change the extensions of those files in the xml.

For Word 2013 you also need to change the tags <a:embed ... to <a:link ... for it to work (with relative paths).

2
  • nice to hear you solved the problem. Please up-vote the answer if it helped you find the solution.
    – Adam
    Mar 20, 2014 at 7:15
  • @Adam: I was already aware of the fact that I could rename docx to zip, hence my remark that the files are separately in the docx in the question. My problem was with how to create a XML document that referenced those files externally. Thanks for your help anyway though.
    – Herman
    Mar 20, 2014 at 10:11
0

You can rename the DOCX file as a .zip and open it using any standard program like Winzip. You can then extract all images from document\media to your hard drive. From there you will need to work out how to automate (most likely via macro) the replacement of the embedded images to the linked ones on the hard drive.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .