Welcome to WebmasterWorld Guest from 54.167.102.69

Forum Moderators: ocean10000

Message Too Old, No Replies

ASP to create MSWORD

What am i missing here...?

     
12:53 pm on Aug 28, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 21, 2002
posts:73
votes: 0


Hi

The following code:


<%@ LANGUAGE="VBSCRIPT" %>
<%
Dim MyDoc
Set MyDoc = Server.CreateObject("Word.Document")
Response.ContentType = "application/msword"
MyDoc.Application.Visible = True
Set MyDoc = Nothing
%>

I get the following error:


Server object, ASP 0177 (0x80080005)
Server execution failed

I'm using IIS5 on WinXpPro with Office2k.

Does anyone know why it happens?
(i Guess it got something to do with the components...)

1:04 pm on Aug 28, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 13, 2002
posts:2162
votes: 0


Not sure, but dont you need to create a word.application first?

What are you trying to do, make the document visible on the web server ?

1:15 pm on Aug 28, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 21, 2002
posts:73
votes: 0


All i'm trying to do is to create a simple document.

Let's take this sorce code for example:


<%
Dim MyDoc
Set MyDoc = Server.CreateObject("Word.Document")
Response.ContentType = "application/msword"
MyDoc.Application.Visible = True
MyDoc.content.Font.Bold = True
MyDoc.content.Font.Italic = True
MyDoc.content.Font.Underline = True
MyDoc.content.Font.Name = "Comic Sans MS"
MyDoc.content.Font.Size = 25
MyDoc.content.insertAfter "word1 word2 word3 word4"
MyDoc.content.InsertParagraphAfter
MyDoc.Words(1).Font.Size = 10
MyDoc.Words(1).Font.ColorIndex = 1
MyDoc.Words(2).Font.Size = 20
MyDoc.Words(2).Font.ColorIndex = 2
MyDoc.Words(3).Font.Size = 30
MyDoc.Words(3).Font.ColorIndex = 3
MyDoc.Words(4).Font.Size = 40
MyDoc.Words(4).Font.ColorIndex = 4
MyDoc.PrintOut
Set MyDoc = Nothing
%>

it works on my PWS on WIN98, but not on my WinXP IIS5.

The error code on my log says something like:


The server {00020906-0000-0000-C000-000000000046} did not register with DCOM within the required timeout.

any idea?

Xoc

4:29 pm on Aug 28, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 18, 2001
posts:1437
votes: 0


It might be that you have Word installed incorrectly. I would try reinstalling it. I base that on this [msdn.microsoft.com] info from the Microsoft web site.

There are also some issues with activating an out of process program from an Active Server Page. In IIS 4.0, there was a metabase variable that you had to set, but apparently that is no longer required in IIS 5.0.

5:30 pm on Aug 28, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 21, 2002
posts:73
votes: 0


I,ve been in the Microsoft page your talking about.

I tries to reinstall all my office.

still,

Not working.

I'm 98% positive the problem is with my IIS and not with the Office.

5:43 am on Oct 31, 2002 (gmt 0)

New User

10+ Year Member

joined:Feb 2, 2002
posts:25
votes: 0


could be a permissions issue. To test, you might want to create a temp Virtual directory and then give execute, read, write, etc. permissions in IIS.

I use a process in a ColdFusion app that creates an instance of MS Word. When I first did it I was getting a similar error from the ColdFusion Service. I just gave the proper permissions in IIS, the physical directory in Win2k, and checked an option under services that stated "enable interaction with desktop". Worked fine after that.

You might want to comment your code after
Dim MyDoc
Set MyDoc = Server.CreateObject("Word.Document")

to see if this line is giving you the problem, if not then comment line by line to find out which specific line is the problem.

6:31 pm on Oct 31, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
posts:4392
votes: 0


I sent you a sticky mail with an off this topic but related question.
6:57 pm on Oct 31, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 21, 2002
posts:73
votes: 0


and i answer you :-)