Thanks for this. I took your advice and reworked the bookmark XML tags via XPath queries, and got it to work. Then I since replaced all the bookmarks with content controls as I understand this is a better way of binding data to content in the new Word format, and it also allows creation of new table rows to be binded when you need dynamic table content generation. So, that's all great and working, and in my dev environment the response.writefile sends the content nicely to the browser and after clicking Open on the resulting 'File Download - Security Warning' dialog box, it automatically opens up word 2007 and displays just fine. Great! BUT when I come to put the app on a new web server (with Word 2007 installed so I can check it's working) the response.writefile produces the file dialog that doesn't have the Open button option. Instead of the right name of the file to be shown it shows the name of the aspx page from where it is sent, and the Type says 'Unknown File Type'. The only options are to Save or Cancel. Saving does indeed store a valid Word 2007 file.
I thought the problem must be the content type setting of the response object (which was "application/vnd.ms-word.document.12"), so I checked the setting in the registry to handle .docx files (in: HKEY_CLASSES_ROOT\MIME\Database\Content Type\ it has:
application/vnd.openxmlformats-officedocument.wordprocessingml.document
So I set this up, and in my dev environment again it works fine, but on the web server again I get the same problem. Maybe it's not the contentType setting? Any ideas on how to resolve this problem?
Thanks, SubGoat