Creating a DOCX Out of Thin Air
Suppose you were stranded on a desert island, and you wanted to create a document. A “Hello World!” document, just to let the world know you’re out there.
And let’s say you’re going to send it to a bunch of people back at the office who are all running Office 2007. (You’ve been on this island for quite a while, see, or maybe you work in DPE.) Office 2007 can open anything from a text file to a DOCX, but you’d like to send a DOCX, just to look cool and to show your support for open non-proprietary technology.
But you only have a crude computer with no application software installed. Maybe it’s running Windows XP, or maybe even Win95. Or it could be a Mac, or a Linux box, or even some old DOS machine or an Apple II or something.
Sounds like you need to create a DOCX out of thin air. No problem. You’ll need three things to do it:
1) A folder-based file system. CP/M or TSO won’t do — ideally you want something designed in the last 25 years or so. I used XP.
2) A text editor. I used Notepad.
3) Some way to compress a ZIP archive, and it needs to be a version that handles folders within the archive. I used WinZIP.
Here’s what to do …
First, create two folders. On my XP laptop, I just put them on the desktop. These folders should be named _rels and word.
Next create a text file at the same level as these folders (e.g., also on the desktop), and put this chunk of XML in it.
That’s just some XML that defines two content types: package relationships and a WordProcessingML document. Save the text file, and rename it [Content_Types].xml. You should then have two empty folders and a content-type file, all in the same folder or on your desktop.
OK, we’ve create three of the five things we’ll need to make this document work. We’re over half done!
The next thing we need to create is the relationships file. Create a text file in the _rels folder, and put this content in it.
That’s some xml that basically says “this officeDocument’s outermost part is the document.xml file in the word folder.” Save this text file, and name it .rels. (Yes, just an extension — note that in the content types we said, in essence, “anything with a rels extension defines package relationships.”) If you’re running Windows, you can’t rename a file to an extension only from the GUI shell, so you’ll need to go to the command prompt to do this or find some other way. Deal with it.
The final step is to create the document.xml file in the word folder. That one should contain this chunk of WordProcessingML.
Note that we could also have a _rels folder within the word folder, to define relationships to document.xml. But we didn’t bother, because there are no other parts in this document for document.xml to have a relationship with. When you have no relationships, life’s simple.
That’s it, you’ve created the contents of a DOCX file. Now you just need to package it up. Go back to your top level folder and ZIP the three pieces (the two folders and the content-types file) into a ZIP archive, then rename it something like HelloWorld.docx. Then open it in Word 2007, and it should look something like the image to the right.
If you have the Word 2007 beta but don’t want to bother with the steps above, here’s a link to a HelloWorld.docx that was created exactly as outlined above.
This document has many key parts and items missing. It has no document properties and no application properties. It has no support for most common content types. It has no headers, footers, styles, themes, tables, fonts, or other typical document elements. But it’s an Office Open XML document, and Word 2007 will open it without complaint.
Suppose you want to add an image to this document. That gets a little messier. You have to add a content type for the image format (jpeg, say), then you have to define a relationship for the image and insert some WordProcessingML into document.xml to add the relationship to the document. You also have to put the image file somewhere in the document — Word puts them in a media folder, which is a good idea, but you can just throw it in the word folder if you’re feeling lazy, and make the relationship point to it there. If you do all of those steps, you get a document something like this one, which looks like this in Word 2007.
So you can create a DOCX that Word 2007 (or any other Open XML consumer) will open, and you can do it without Office 2007, or prior versions of Office, or any other software written in the last decade for that matter. You can create it right out of thin air. This isn’t the easiest way to go about things, of course, and it’s certainly not a best practice, but it demonstrates the openness of the new Office Open XML file formats in a simple and straightforward way.
The obvious variation, to create a DOC file from thin air, will be left as an exercise for the reader. ![]()
This entry was posted on Friday, March 31st, 2006 at 11:08 pm. You can subscribe to comments on this post through its RSS feed.

on April 1, 2006 at 11:34 am Dave wrote:
To create a document out of thin air I would rig up a computer out of coconuts. I saw the professor do something similar on Gilligan’s Island.
Still happy with the Cingular 2125?
on April 1, 2006 at 12:14 pm Doug wrote:
Hi, Dave. yes, I’m still quite happy with the Cingular. Haven’t really got used to the predictive typing bit yet, but I love the features. I have to re-boot it every day or two when it gets in some weird mode where it can’t sync due to “waiting for network” (but can send/receive calls), but that’s the only negative experience I’ve had so far. You thinking of getting one?
on April 2, 2006 at 10:36 am Dave wrote:
I am definately thinking about getting one.
I tried one out at the Cingular store but they had a s-l-o-w connection for it there (inside a mall) so I could not really see how a few web sites would render on it. It took forever for amazon.com to appear on it.
The size is absolutely perfect and feels well-balanced in the hand.
As for predictive typing, I text message and write emails in both English and Spanish so I hope it has the ability for me to tailor it.
I think I’ll stop at a different Cingular store this coming week.
Thank you for the feedback.
on April 2, 2006 at 12:49 pm Doug wrote:
As for browsing speed, the 2125 is definitely slower than my laptop and my Cisco router, but it’s way faster than the Blackberry I had before it.
Although maybe Amazon is a worst-case test — I just tried going there, and it took over 20 seconds for the home page to appear. By comparison, this page loads in about 4 seconds (not cached, but a refresh).
on April 2, 2006 at 1:07 pm Dave wrote:
thank you again for your feedback. much appreciated doug!
may blue skies bless the seattle area soon…