I'm creating a page that pulls a document from a server. The whole concept
is for ISO. The header of the document is controlled by an SQL database.
Once the header of the document is displayed I need to be able to insert the
form (which is the word document) right below the header. I did think of
using frames and just use a "link" which would populate the bottom frame
with the document, but I was hoping that I would be able to insert the
document in the web page where it looks as if it is just one web
page....header and the form. I hope that makes sense.
For a test I downloaded the following code which is suppose to display a
document in the web page. It is as follows, but I get the same error:
<HTML>
<HEAD>
<TITLE>Using ASP To View & Print A Word Document</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY bgcolor="#FFFFFF">
<FORM method="post" action="WordViewer.asp" name="frmMain">
<TABLE width="600" border="1" cellspacing="0" cellpadding="4"
align="center" bordercolor="#000000">
<TR>
<TD colspan="2" align="left" valign="top" bgcolor="#000000"><FONT
size="2" face="Verdana, Arial, Helvetica, sans-serif"
color="#FFFFFF"><B>Viewing
& Printing MS Word Documents Using ASP</B></FONT></TD>
</TR>
<TR align="left" valign="top" bgcolor="#999999">
<TD width="40%" rowspan="2"><FONT size="2" face="Verdana, Arial,
Helvetica, sans-serif">Word
Document To View Print<BR>
<INPUT type="File" name="fldFilePath">
</FONT></TD>
<TD width="60%"><FONT size="2" face="Verdana, Arial, Helvetica,
sans-serif">
<INPUT type="checkbox" name="chkPrint" value="PrintDoc">
<FONT size="1">Check To Enable Printing</FONT></FONT></TD>
</TR>
<TR align="left" valign="top">
<TD width="60%" align="left" valign="top" bgcolor="#999999"><FONT
size="2" face="Verdana, Arial, Helvetica, sans-serif"><FONT size="1">
<INPUT type="submit" name="Submit" value="Open Document">
</FONT></FONT></TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
<%
'our variable
Dim strDocPath
Dim intPrintCount
'get the path To the document to
'view and the value To see if the
'user wants To print this document
strDocPath = Request.Form("fldFilePath")
bolPrintDoc = Request.Form("chkPrint")
'lets see if we have a path
'if we Do Then show the doc
if strDocPath > "" Then
'we have a path so lets show the document
'create the object
Set objWord = CreateObject("WORD.Application")
'Show The Word Application
objWord.Visible = True
'open the document
objWord.Documents.Open strDocPath
'lets see if we need To print it out
if bolPrintDoc = "PrintDoc" Then
'lets print it To the default printer
objWord.PrintOut
End if
'clear it from mem
Set objWord = Nothing
End if
%>