downloading a word document

Results 1 to 2 of 2

Thread: downloading a word document

  1. #1
    Join Date
    Dec 1969

    Default downloading a word document

    Hi All,<BR><BR>I&#039;m trying to make an application that customizes a word document. <BR><BR>Stage one is to open a word document and download it. I&#039;m using the OpenTextFile and (Response.binaryWrite(x) or Response.Write). In both cases the file is altered when it arrives on the PC. <BR><BR>First question: Is there a binary open command? soit does not alter the file.<BR><BR>Stage two, I will replace a string in the file like this "&#060;User Name&#062;". <BR><BR>Second question: Is there a substring replace command?<BR><BR>Thanks to all,<BR><BR>Scott Johnson<BR>scott_at_Wilty_dot_ca<BR>

  2. #2
    Join Date
    Dec 1969

    Default Tough to do...

    To do the replace, you have to open the word doc *USING WORD*. That means you have to "script" the MS Word application. No, I have no idea what all the scripting commands for it are, but I&#039;m sure if you poke around in you can likely find them.<BR><BR>Then you have to save the altered document *back* on the server&#039;s file system.<BR><BR>Finally, you have to allow the user to download the altered ".doc" file. Easiest way to do that is to simply put the altered doc someplace accessible to the web server and let the user click on a hyperlink to it. You *can* serve up a binary file, using ADODB.Stream (*not* FSO!), but if you are serving up a custom-altered file there seems little point in that.<BR><BR>Anyway, this is all a pain to do, comparatively.<BR><BR>

Posting Permissions

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