473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

CreateObject("word.Application")

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
4 16121
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
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: The Roys | last post by:
Hi Im doing something wrong in quitting the Word.Application in my VB program. I have General Declarations Dim AppWord As Word.Application Form_Load() Set AppWord =...
3
by: Greg Andora | last post by:
Hello, I've had an ASP page that worked for at the minimum for a year and now it is acting very odd and I need some help to fix it. What my page does/did is creates a Word.Application object and...
2
by: MaxiWheat | last post by:
Hi, I am using a software that uses MS Word to create PDF files. When I try to run the sample code (ASP 3.0), I get an error on this statement : Set oWord =...
2
by: POLILOP | last post by:
When i try to do this Dim ExcelFace Set ExcelFace = CreateObject("Excel.Sheet") ......... the browser says this Error Type: Microsoft VBScript runtime (0x800A0046) Permission denied:...
0
by: Svet | last post by:
CreateObject("Excel.Application") on NT 4.0 hangs and I have to kill the Access 97 app that it is running on. The same code works fine as a stand alone code. This occurs on users' machines thatt...
4
by: Darryl Kerkeslager | last post by:
Below is a section of the code I use to open Word with late binding, insert text at the selected bookmarks, and make Word visible. Everything works fine. However, I also have some Word check...
5
by: KC | last post by:
Hi, I have code similar to this.. Dim xlApp As Object xlApp = CreateObject("Excel.Application", "\\MyServer") The call is from a asp.net (Intranet) application. \\Myserver is a network...
1
by: Raúl Martín | last post by:
I´ve a function in asp that run correctly but If I tried to change it forasp.net in asp: xmlHTTP = CreateObject("Microsoft.XMLHTTP") And I thought to use this sentence for asp.net but the...
1
by: David Di Donato | last post by:
hi i have a big problem. i have an asp file with the following source code.... ****** Set r_ = Server.CreateObject ("Access.Application.10") s1 = "DoAnything()" with r_
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.