Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes HTML, CSS and JavaScript and the fly likes open Word Document from JavaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "open Word Document from JavaScript" Watch "open Word Document from JavaScript" New topic
Author

open Word Document from JavaScript

narayana Ega
Greenhorn

Joined: Aug 23, 2012
Posts: 26
Hi All,

I tried the below code to open word document from browser ,it is ok in Internet Explorer but it is not working in Firefox and Chrome.


<html>
<head>
<script type="text/javascript">



function openWordDocPath()
{
var objWord;
objWord = new ActiveXObject("Word.Application");
objWord.Visible = true;
objWord.Documents.Open("\\\\sinhyd800\\SCM\\PeerReview\\SCMWebsiteUserDocumentation\\UserDocumentationForSCMReleaseWebsiteRev-3.doc");
}
</script>
</head>
<body>
<form onSubmit="openWordDocPath()">
<input type="submit" value="submit">
</form>
</body>
</html>

Can any body help me to get out of this problem............
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
ActiveX is IE Only. Not going to happen in the other browsers.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: open Word Document from JavaScript
 
Similar Threads
document.write doesn't work in netscape
Opening Word
First script for PHP is not working
how to get value of input type file in javascript
A Javascript function is said as "Not a function"