View Full Version : Default view with php generated .docs

11-09-2007, 03:33 PM
I use the below code to create a word document.

header("Content-Type: application/msword");
header('Content-Disposition: attachment; filename="dossier.doc"');

Everything works perfectly except one thing. When the file is first opened it is in Web Layout view in word, if you change it to Print Layout view and save it, then when you open it next it will open in print view.

I read that the file itself says which view is default for it, so I was wondering if there was a way to set this default using php will creating the file.

It would be best if it was compatible with MS Office 2003 and 2007. Any help would be appreciated.

11-09-2007, 03:50 PM
This doesn't have much to do with PHP.

11-09-2007, 04:00 PM
Sorry maybe I wasn't clear.

Is there a way using php to set word document settings such as the default view. The code I included is php to make the webpage downloadable as a doc file.

11-09-2007, 04:00 PM
I highly doubt there is. As with PHP, modifying Word documents is generally not possible unless using a module. And then you would find more help in asking the author of that.

11-09-2007, 04:10 PM
Alright, thanks for the info. I knew it was a long shot but had to try.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum