Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default view with php generated .docs

    I use the below code to create a word document.
    PHP Code:
    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.

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    This doesn't have much to do with PHP.

  • #3
    New Coder
    Join Date
    Oct 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    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.

  • #5
    New Coder
    Join Date
    Oct 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Alright, thanks for the info. I knew it was a long shot but had to try.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •