First of all, can you give us an idea of why you want to do this. That might help us figure out how to do it.
This isn’t a normal request. If you want a WordPress post to be in a Word Document, copy the text and paste it in Word, and play with it. Sometimes you can copy the whole page and paste it and it will sorta look like the original, but not exactly. And the graphics might not come with it.
If you want to have a Word document that people can download, for whatever reason, of your post, then you create a Word document version and upload it to your site and create a link to it on that post.
But if you can help us understand why a little better, we can be more specific.
It’s an interesting idea – I’ve never thought about doing as a word document before, but you can do it as PDF if that’s any good to you via a plugin.
You may to request a plugin for this specific task, as I don’t think you can simply call the document as a word doc.
The only other suggestion I can think of is to create a link which provides the entry in the print.css form, and edit print.css with a very basic style. If you’re looking to include tables and such, you might be able to get away with it. Interesting idea though
Changing the content-type header is like renaming an html file to .doc–sure, Word will try to open it, but it’s not a file made for Word.
You’ll either need to copy/paste or get some sort of exporting plugin. Like Jinsan pointed out there are already PDF exporters.
word documents are binary documents last time I looked… that’s why when you open them up in a text editor they contain gibberish characters everywhere. Here one lead:
http://www.webmasterworld.com/forum47/2732.htm
Your best bet is probably creating an RTF document from your post which word will open. I think there is not a plugin for that, so I might make one, give me a few days.
Hi,
I like to export articles dynamicaly as a word file. Word is a binary file, but you can use also html…
I tried for about two houres and it seems to work :)). The main aspect is, that the html-content (with the word header) is in a tabel (no html-header or body). If you use p-tags, word likes to start a converter tool. But it seems that word has no problem to understand a table with HTML-formats.
to test it, I used a wordpress hack started with
header('Content-type: application/msword');
// Require WordPress Header
require('wp-blog-header.php');
?>
and did all the content of the posts (without html head/body) in a table. ….