This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes HTML, CSS and JavaScript and the fly likes Opening Word Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Opening Word" Watch "Opening Word" New topic
Author

Opening Word

r phipps
Ranch Hand

Joined: Sep 14, 2004
Posts: 60
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not force it since it is the way the user has their browser set up.

Eric
r phipps
Ranch Hand

Joined: Sep 14, 2004
Posts: 60
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

Joined: Feb 09, 2004
Posts: 140
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.


Work like you don't need the money. Love like you've never been hated. Dance like nobody's watching. Sing like nobody's listening. Live like it's Heaven on Earth.
Currently I Reside Here WEBlog
Senthil B Kumar
Ranch Hand

Joined: Feb 09, 2004
Posts: 140
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

Joined: Sep 14, 2004
Posts: 60
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Opening Word