How to zip a WordprocessingML folder into readable docx How to zip a WordprocessingML folder into readable docx xml xml

How to zip a WordprocessingML folder into readable docx


The most common problem around manually zipping together Open XML documents is that it will not work if you zip the directory instead of the contents. In other words, the[content_types].xml file, and the word, docProps, and _rels directories need to reside at the root level of the zip file.


Here are steps to unzip my.docx and re-zip:

% mkdir unzipped% cd unzipped/% unzip ../my.docx    % zip -r ../rezipped.docx *% open ../rezipped.docx 


Further to what Mica said, the contents of the ZIP file are organised according to the Open Packaging Convention; cf. Microsoft's Essentials of the Open Packaging Convention.

You can use the .NET System.IO.Packaging to make and manipulate .docx files; this class is implemented in the Mono project.