Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening Word

 
r phipps
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a table of contents with html to a link of word document's but i want the link to open them up with word not a browser displaying them in word.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not force it since it is the way the user has their browser set up.

Eric
 
r phipps
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is on an intanet, i thought there might be some way with java script to open word and pass it the file name to open with?
 
Senthil B Kumar
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Browser will search for that appropriate application, if found then it will open the document otherwise you will get a save file window.

It will open inside the browser if there's a registered plugin for it.
You have no control over that.
 
Senthil B Kumar
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if a website could launch applications at will on a client computer it could install any software it wanted on that computer. The consequences would be disastrous. No one would be able to visit any website as doing so would leave them wide open to virusses, spyware, and a host of other baddies.
 
r phipps
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get the following to work when it is coded on my c drive but not off of the network drive.

<HTML>
<HEAD>
<SCRIPT LANGUAGE=VBScript>
Dim objWord
Sub Btn1_onclick()
call OpenDoc("http://www.cuhumane.org/CARE/cats101.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">
<p>
</BODY>
</HTML>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic