Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening documents in Word from Web links
Message
De
06/12/2004 05:27:15
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Contrôles ActiveX
Titre:
Opening documents in Word from Web links
Divers
Thread ID:
00967073
Message ID:
00967073
Vues:
45
Hi,
I'm trying to get documents accessed via web links to open in Word on the client machine rather than in the browser window. I've had a look on ms website and found that you can acheive theis using client side vbscript. As follows:
<HTML>
   <HEAD>
   <SCRIPT LANGUAGE=VBScript>
   Dim objWord
   Sub Btn1_onclick()
   call OpenDoc("c:\j126.doc")
   End Sub

   Sub OpenDoc(strLocation)

   Set objWord = CreateObject("Word.Application")
   objWord.Visible = true
   objWord.Documents.Open strLocation
   End Sub

   Sub Btn2_onclick()
   call OpenDoc("c:\circulate.txt")
   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"><BR>
   <BR>
   <INPUT TYPE=BUTTON NAME=Btn2 VALUE="Open Text Doc">
   </BODY>
   </HTML>
This works if it's on the hard drive of my machine but when I try to run it on a web server it errors with "ActiveX component can't create object 'Word.Application'".

I suspect that this is because the code is running on the server side rather than the client side. Does anyone know if this is the case pls?
If it is, how can I get the code to run on the client side?

Thanks,

David
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform