Web Analytics Made Easy -
StatCounter create new word document? - CodingForum

Announcement

Collapse
No announcement yet.

create new word document?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • create new word document?

    Hi all,

    Firstly thanks for all the help I've received from you guys, I'm learning so much faster with your help.

    I've posted several messages concerning a program I am working on which uses a webform to create a document at the end.

    So far I am able to create the doc and copy to clipboard for pasting using the code:

    Code:
    document.all.txtaDocument.value += strDocument
    document.all.txtaDocument.select()
    txttoCopy = document.all.txtaDocument.createTextRange()
    txttoCopy.execCommand("copy")
    I am also able to open a new IE window and populate with the doc:

    Code:
    var w = window.open();
    w.document.write("<html><body style='font-family: courier new;'><pre>" + strDocument + "</pre></body></html>");
    What I would like to do is create a new word doc and populate it with the created document. I've tried with no success using activeX etc. The best I could do was to open an existing word doc, but could not populate it. I need it to open a new blank word window, as it is not practical to have a specified word file already there.

    Any help would be appreciated.

  • #2
    I don't think you can do this from the browser. I'm afraid you may have to do this server-side. And that means running on a windows-based server, no doubt.

    How far did you get using new ActiveXObject( )??? If it works, that would have to be the route you'd go.
    Be yourself. No one else is as qualified.

    Comment


    • #3
      Thanks for the reply. I was afraid that I would have to go server side for this, which I could do, but was hoping not to, as the whole purpose of this project was that it would be primarily client side.

      I must admit I don't quite understand why it wouldn't work though. I'll keep playing with activeX and see what I can do.

      Comment


      • #4
        Show some of your ActiveX code, so we can at least see if you seem to be on right track.

        You *do* know that the object WILL be marked "unsafe for scripting", so your clients will have to have your site in their "most trusted" security list *and* still permit the scripting on each use?
        Be yourself. No one else is as qualified.

        Comment

        Working...
        X