Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Open Word Doc from asp

Reply
Thread Tools

Open Word Doc from asp

 
 
Anne Richmond
Guest
Posts: n/a
 
      05-12-2004
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>


 
Reply With Quote
 
 
 
 
Jeff Cochran
Guest
Posts: n/a
 
      05-12-2004
On Wed, 12 May 2004 15:10:24 +0100, "Anne Richmond"
<(E-Mail Removed)> wrote:

>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

><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>
>


 
Reply With Quote
 
 
 
 
TomB
Guest
Posts: n/a
 
      05-12-2004
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?


"Anne Richmond" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.pdf doc to word doc PWB Computer Support 14 09-19-2008 10:41 PM
Open Word Doc in Word, not in Browser Franck ASP .Net 1 09-09-2005 07:37 AM
XML from Word -- formerly Create pdf from existing Word doc (asp.net) Sharon ASP .Net 0 07-27-2005 02:07 AM
String[] files = {"a.doc, b.doc"}; VERSUS String[] files = new String[] {"a.doc, b.doc"}; Matt Java 3 09-17-2004 10:28 PM
Parsing MS Word client doc into server-side doc... John Wallace ASP .Net 0 07-22-2003 06:49 PM



Advertisments