how to open a word document

Results 1 to 2 of 2

Thread: how to open a word document

  1. #1
    zehua weng Guest

    Default how to open a word document

    Hi all,<BR><BR>I have a problem to open a word document on client side,I have word installed on server side,but nothing happend just a blank browser screen,not even an error message. I attach my code here,could someone help me out?<BR><BR>Dim w,wDoc<BR>Set w=Server.CreateObject("Word.Application")<BR>set wDoc=w.Application.Documents.Open("D:ftprootPayrol lppsASP-1merge_grad_blank.doc")<BR>wDoc.close<BR>set wDoc=Nothing<BR>set w=Nothing

  2. #2
    Join Date
    Dec 1969

    Default RE: how to open a word document

    You should specify the content type via ASP. Here is my code. You will have to modify it slightly as it gets its binary info from a database.<BR><BR><BR>&#039 Clear out the existing HTTP header information<BR>Server.ScriptTimeout = 600<BR>Response.Expires = 0<BR>Response.Buffer = TRUE<BR>Response.Clear<BR><BR>Response.ContentType = "application/msword"<BR><BR>if DataCommand.eof then Response.End<BR>if isnull(DataCommand(1)) then Response.End<BR><BR>Response.BinaryWrite DataCommand(1)<BR>DataCommand.Close<BR>Set DataCommand = Nothing <BR>Response.End<BR>%&#062;

Posting Permissions

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