Open Word Doc from asp

A

Anne Richmond

I got the following code from a website somewhere. When I try to run it I
get the error - Activex component can't create object "Word.Application".

It is running on localhost and test2.doc does exist.

What have I missed?

<HTML>
<HEAD>
<SCRIPT LANGUAGE=VBScript>
Dim objWord
Sub Btn1_onclick()
call OpenDoc("Test2.doc")
End Sub
Sub OpenDoc(strLocation)
Set objWord = CreateObject("Word.Application")
objWord.Visible = true
objWord.Documents.Open strLocation
End Sub
</SCRIPT>
<TITLE>Launch Word</Title>
</HEAD>
<BODY>
<INPUT TYPE=BUTTON NAME=Btn1 VALUE="Open Word Doc">
</BODY>
</HTML>
 
J

Jeff Cochran

I got the following code from a website somewhere. When I try to run it I
get the error - Activex component can't create object "Word.Application".

It is running on localhost and test2.doc does exist.

What have I missed?

Is Word installed...? :)

The Office web components should also be installed for this method I
believe.

Jeff
 
T

TomB

Where is Test2.doc? You don't have a path at all, and I bet it's not in the
users Temporary Internet Files.
have you lowered your security settings to allow this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top