Generating Word Documents from a Domino Form

A web application I am working on at the moment needs some reports that can be generated ad hoc by the users. Normally I'd do reports in PDF format using FOP, but the requirement this time was for Microsoft Word documents to be produced. So after a little bit of reading and playing around I found what I think is a neat solution. (Because of this I'm sure someone has done this before so forgive me if I've stolen your idea!)

So I have a web application, I created a new view of the documents I want to be able to report on and set a form formula to override the default form when they are opened through this view. Then I created a new form, and this is the key bit, set the content type of the form to Other, "application/msword". Then the actual Word document can be generated using plain old HTML, but the nice thing is that when you open the document with a browser it will be treated as though it was a "proper" Word document.

Notes Form outputting Word.jpg
That was really badly explained, but you can see a demo here. And if you want to play then feel free to download the NSF from here.