SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    Apr 2003
    Location
    UK
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can you create an external document from JavaScript ?

    I have a small database application using PHP & Client side Javascript for the user interface.

    Presently to generate a MS Word document an ODBC connection is made to the database. This is fine for a mailmerge, but a pain for a one off document.

    Is it possible to invoke MS Word and pass some data (from the fields on the current web page) to it using JavaScript ?

  2. #2
    Must try harder! linmed01's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I very much doubt it. Maybe VB script?

  3. #3
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, neither VBScript or Javascript alone will be able to do this. ActiveX and it's FileSystemObject will need to be involved. You'll have to look around to see about doing stuff with Word, because that I don't know.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know how to pull it off, but perhaps the fields on the current web page could be submitted to a php file on the server which would use the COM support in 'PHP for Windows' to talk to Word.

    This looks like a question for one of the php gurus
    Edit:

    We might need a COM guru too

  5. #5
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This example might be useful.

  6. #6
    Under Construction Poop_Shoot's Avatar
    Join Date
    Jul 2003
    Location
    Sacramento, CA
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As beetle stated earlier you could use the activeXObject and create a text file!


    This link will explain all!

    http://msdn.microsoft.com/library/de...stemObject.asp

  7. #7
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I think that using COM for PHP would definantly be easier, more cross-browser compliant too!

    Here is a link to a good article which uses Word as an example too

  8. #8
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome article!

    Makes me want to install php on my desktop

    Thanks DJ P@CkMaN!

  9. #9
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:


    More fun with PHP + COM:
    http://www.sitepointforums.com/showp...51&postcount=4

  10. #10
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by alex monaghan
    Is it possible to invoke MS Word and pass some data (from the fields on the current web page) to it using JavaScript ?
    OK, now I read the original question...
    You mean invoke MS Word on the client ?


    Edit: Something like this?
    http://www.sitepointforums.com/showp...45&postcount=2


Bookmarks

Posting Permissions

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