By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,247 Members | 871 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,247 IT Pros & Developers. It's quick & easy.

CreateObject("word.Application")

P: n/a
I'm trying to display a word document inside a web page, but everytime I do
I get this error:

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied: 'CreateObject'

Does anybody know the correct way to do this? I don't want to link to a
document, but rather display a word file inside the asp page.

Any help will be greatly appreciated!

Clay
cl***********@hotmail.com
Jul 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I would think you can just set Response.ContentType and stream the file to
the browser. Why would you be creating a Word Application object on the
server ? Are you perhaps dynamically creating the file on the fly in the asp
? These are really two separate issues.

"Microsoft" <cl***********@hotmail.com> wrote in message
news:ub**************@tk2msftngp13.phx.gbl...
I'm trying to display a word document inside a web page, but everytime I do I get this error:

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied: 'CreateObject'

Does anybody know the correct way to do this? I don't want to link to a
document, but rather display a word file inside the asp page.

Any help will be greatly appreciated!

Clay
cl***********@hotmail.com

Jul 19 '05 #2

P: n/a
"Microsoft" <cl***********@hotmail.com> wrote in message
news:ub**************@tk2msftngp13.phx.gbl...
I'm trying to display a word document inside a web page, but everytime I do I get this error:

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied: 'CreateObject'

Does anybody know the correct way to do this? I don't want to link to a
document, but rather display a word file inside the asp page.

Any help will be greatly appreciated!


You can't really "display a word file inside the asp page". You could
simulate it using an IFRAME perhaps.

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #3

P: n/a
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
%>

"Microsoft" <cl***********@hotmail.com> wrote in message
news:ub**************@tk2msftngp13.phx.gbl...
I'm trying to display a word document inside a web page, but everytime I do I get this error:

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied: 'CreateObject'

Does anybody know the correct way to do this? I don't want to link to a
document, but rather display a word file inside the asp page.

Any help will be greatly appreciated!

Clay
cl***********@hotmail.com

Jul 19 '05 #4

P: n/a
How about saving the Word doc as html ? You may be able to do this with
automating Word.Application like you were originally attempting. Create the
object, run the SaveAs function, close the object, append the new html file
to your output with #include or something...
"Microsoft" <cl***********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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
%>

"Microsoft" <cl***********@hotmail.com> wrote in message
news:ub**************@tk2msftngp13.phx.gbl...
I'm trying to display a word document inside a web page, but everytime I

do
I get this error:

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied: 'CreateObject'

Does anybody know the correct way to do this? I don't want to link to a
document, but rather display a word file inside the asp page.

Any help will be greatly appreciated!

Clay
cl***********@hotmail.com


Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.