If I understand the question correctly, I believe that the code listed below
will provide the requested functionality:
<%
Response.Buffer = True
Response.Clear
Response.AddHeader "content-disposition", "attachment; filename=tmp.doc"
Response.ContentType = "application/msword"
set fObj = server.createobject("Scripting.FileSystemObject")
set tObj = fObj.OpenTextFile("c:\temp\tmp.doc", 1, false, -1)
Response.BinaryWrite(tObj.readAll)
tObj.close
set tObj = nothing
set fObj = nothing
Response.End
%>
First we set page output to buffered, then we clear any buffered HTML that
may exist. Next the content-disposition header is sent to client and the
content type is set from default (text/html) to Word. Finally the word
document is opened in a Unicode format (last argument is format), written
back to client using BinaryWrite and all page processing is stopped.
Hope that helps!
--Ben
----- Original Message -----
From: "Sheriff's Webteam" <[EMAIL PROTECTED]>
To: "ActiveServerPages" <[EMAIL PROTECTED]>
Sent: Wednesday, August 28, 2002 10:57 AM
Subject: RE: Word Doc open in Word of client
> Does anyone have an answer for this?
>
> -----Original Message-----
> From: Huang, George C.H. [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 07, 2002 10:22 AM
> To: ActiveServerPages
> Subject: Word Doc open in Word of client
>
>
> Dear Experts,
> I wrote a ASP page to generate a MS-Word document in my web Server.
> And I know I can use
> window.location.replace(document.thisForm.sFileName.value) (javascript) in
> client side to open this word document, which will be embeded in browser.
(I
> am using IE).
> Is there anyway I can copy this word document to client and open it
> in MS-Word(application)?
>
> Thank you in advance for your help.
>
> George
>
> ---
> You are currently subscribed to activeserverpages as:
> [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> %%email.unsub%%
>
> ---
> You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
%%email.unsub%%
---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]