Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server error on the following ASP code

Status
Not open for further replies.

thelordoftherings

Programmer
Joined
May 16, 2004
Messages
616
Location
IL
Hello,

When I am running standard ASP on the IIS it is working fine but when I run the following code example which I've downloaded from activepdf.com along with the PDF Server I receive HTTP 500 - Internal server error
Any ideas...?

<%
' Define Variables
' Local Path
varPath = Server.MapPath(".")

' PDF output name
varPDFName = "word.pdf"

' Word File To Convert
varWordFile = "word.doc"

' Timeout for Wait
varTimeout = 60

' Instantiate Object
Set APS = Server.CreateObject("APServer.Object")

' Set Server Properties
APS.OutputDirectory = varPath
APS.NewDocumentName = varPDFName

' Tell Server to begin the print process
varReturn = APS.StartPrinting()
If varReturn <> 0 Then Error("StartPrinting") End If

' Word Automation
Set WordObject = Server.CreateObject("Word.Application")
WordObject.DisplayAlerts = False
Set NewDoc = WordObject.Documents.Open((varPath & "\" & varWordFile), False, True)
Set WordDialog = WordObject.Dialogs(97)
WordDialog.Printer = APS.NewPrinterName
WordDialog.DoNotSetAsSysDefault = 1
WordDialog.Execute
NewDoc.PrintOut False
NewDoc.Close False
WordObject.Quit False
Set WordObject = Nothing

' Tell Server to end the print process
varReturn = APS.StopPrinting()
If varReturn <> 0 Then Error("StopPrinting") End If

' Wait for the conversion results
varReturn = APS.Wait(varTimeout)
If varReturn <> 0 Then Error("Wait") End If

' Clear Server Object
Set APS = Nothing

' Conversion Successful
Response.Write "Done!"

' Error Handling
Sub Error(Method)
Response.Write "'" & Method & "' failed with a '" & varReturn & "'<br>"
Response.Write "<a href=' Response.Write "support/kb/?id=10549&tk=ts'>"
Response.Write "KB Article for Return Codes</a>"
Set APS = Nothing
Response.End
End Sub
%>
 
cant tell anything from that error...can you go to tools->internet options->advanced and then uncheck the box which says "Show HTTP friendly messages"

and then post the actual error message...

-DNG
 
OK, Now the error I receive is this:

Microsoft Word error '800a175d'

Could not open macro storage.

/WordToPDF.asp, line 29
 
I've seen this arcticle but I don't understand where do I find this:
"In this scenario, you can change the user to "Interactive User" in the Internet Service Manager Microsoft Management Console, right-click your package, click the Identity tab, and then click Interactive User."
Can you please elaborate?
 
OK, I've changed the Word DCOM Component Identity and now I receive this error:

Server object error 'ASP 0178 : 80070005'

Server.CreateObject Access Error

/WordToPDF.asp, line 27

The call to Server.CreateObject failed while checking permissions. Access is denied to this object.

Any ideas...?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top