473,686 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CreateObject("w ord.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***********@h otmail.com
Jul 19 '05 #1
4 16176
I would think you can just set Response.Conten tType 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******** ******@tk2msftn gp13.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***********@h otmail.com

Jul 19 '05 #2
"Microsoft" <cl***********@ hotmail.com> wrote in message
news:ub******** ******@tk2msftn gp13.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="#FFFFF F">
<FORM method="post" action="WordVie wer.asp" name="frmMain">
<TABLE width="600" border="1" cellspacing="0" cellpadding="4"
align="center" bordercolor="#0 00000">
<TR>
<TD colspan="2" align="left" valign="top" bgcolor="#00000 0"><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="#99999 9">
<TD width="40%" rowspan="2"><FO NT size="2" face="Verdana, Arial,
Helvetica, sans-serif">Word
Document To View Print<BR>
<INPUT type="File" name="fldFilePa th">
</FONT></TD>
<TD width="60%"><FO NT 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="#99999 9"><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("f ldFilePath")
bolPrintDoc = Request.Form("c hkPrint")
'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("W ORD.Application ")
'Show The Word Application
objWord.Visible = True
'open the document
objWord.Documen ts.Open strDocPath
'lets see if we need To print it out
if bolPrintDoc = "PrintDoc" Then
'lets print it To the default printer
objWord.PrintOu t
End if
'clear it from mem
Set objWord = Nothing
End if
%>

"Microsoft" <cl***********@ hotmail.com> wrote in message
news:ub******** ******@tk2msftn gp13.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***********@h otmail.com

Jul 19 '05 #4
How about saving the Word doc as html ? You may be able to do this with
automating Word.Applicatio n 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******** ********@tk2msf tngp13.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="#FFFFF F">
<FORM method="post" action="WordVie wer.asp" name="frmMain">
<TABLE width="600" border="1" cellspacing="0" cellpadding="4"
align="center" bordercolor="#0 00000">
<TR>
<TD colspan="2" align="left" valign="top" bgcolor="#00000 0"><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="#99999 9">
<TD width="40%" rowspan="2"><FO NT size="2" face="Verdana, Arial,
Helvetica, sans-serif">Word
Document To View Print<BR>
<INPUT type="File" name="fldFilePa th">
</FONT></TD>
<TD width="60%"><FO NT 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="#99999 9"><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("f ldFilePath")
bolPrintDoc = Request.Form("c hkPrint")
'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("W ORD.Application ")
'Show The Word Application
objWord.Visible = True
'open the document
objWord.Documen ts.Open strDocPath
'lets see if we need To print it out
if bolPrintDoc = "PrintDoc" Then
'lets print it To the default printer
objWord.PrintOu t
End if
'clear it from mem
Set objWord = Nothing
End if
%>

"Microsoft" <cl***********@ hotmail.com> wrote in message
news:ub******** ******@tk2msftn gp13.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***********@h otmail.com


Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
13570
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 = CreateObject("Word.Application")
3
5338
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 a new document from a template. It then proceeds to fill in a bunch of the information on the word document using bookmarks and data from a database. Then it saves the document to a directory and sends the user off to go get the new document. ...
2
10238
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 = Server.CreateObject("Word.Application") That error says : The call to Server.CreateObject failed while checking permissions. Access is denied to this object.
2
5501
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: 'CreateObject'
0
1538
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 have weird builds and I was wondering if anyone has seen this and can shed some light what I can look into. Thanks.
4
8006
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 boxes, that I cannot figure out how to make 'checked'. I am not allowed to alter the layout of the form; it must be a check box. Up until now, I have simply required users to check the box themselves, but now I'm opening up four Word forms that all...
5
9366
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 computer in the same domain as web server. The only way I can get this call worked is when I add the user who logs on to the web site as Administrators. I need to get this working without having to make the user administrator. Any suggestion?
1
6575
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 server don´t response right. xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
1
4863
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
8586
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8523
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9057
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8778
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4317
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1943
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.