Results 1 to 2 of 2

Thread: MS Word content to page

  1. #1
    Join Date
    May 2007
    Thanked 207 Times in 205 Posts

    Default MS Word content to page

    Is there anyway I can get the content from a word file to a webpage assuming I have word on the server and the doc file?
    Corrections to my coding/thoughts welcome.

  2. #2
    Join Date
    Mar 2006
    Illinois, USA
    Thanked 690 Times in 678 Posts


    You want to convert a .doc to a .htm file? (Or through a .php file).
    Or do you want to get the text content of the .doc and insert it somewhere in another file?

    Either way, I expect it will be tricky. .docx is an entirely different format from .doc, and both will have their own issues/ways to do this.

    I'd suggest converting them manually.

    Assuming that doesn't work, maybe something like google documents would help: use some sort of API to import then export and get back a .htm or .txt file to work with.

    There may be some way out there, but doing this yourself would be a big project to say the least.

    As far as I know, Microsoft goes out of its way to stop this sort of thing from happening. Apparently .docx (though less usable in other programs) is actually easier to work with (XML, right?), but I'm not sure what that will really help with. Perhaps strip_tags() would get you some sort of preview...

    What reasons are there for not using another format? Could you use word to export something nicer like .htm, .txt, .rtf, etc? Or perhaps use open office.

    Here are a few helpful links from google, though mostly they're just saying that you can't really do it.
    In that, I like the idea of running MS Office on the server as an automated process, but that would get messy of course.
    Looks very helpful, if you can get the library working on your server.
    Lots of tangents, but some interesting (and complex) posts in the middle.
    Last edited by djr33; 07-12-2010 at 03:51 AM.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum


Posting Permissions

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