Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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

open Word Document from JavaScript

narayana Ega

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.

<script type="text/javascript">

function openWordDocPath()
var objWord;
objWord = new ActiveXObject("Word.Application");
objWord.Visible = true;
<form onSubmit="openWordDocPath()">
<input type="submit" value="submit">

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

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

I agree. Here's the link:
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"