On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.
As to your question, no browser but IE supports ActiveXObject, so you're limited to one particular browser on one particular operating system. Why not just link to the document, and let the user decide what to do with it (open it with some application, or save it to disk)?
Hi thanks for the quick replay but my problem is i have to launch the MSoffice plugin XA which is xml editor. But it will lauch in similar way as MSoffice doc document. So here wht we are trying to do is we will let clients to open the doc and edit and it will get save in server itself.
Before you post again, please change you display name.
window.open("foo.doc") or window.location.href="foo.doc"; will open the doc in word if the user has their computer set up right.
Other than that you have no control.
shalu pareek
Greenhorn
Joined: Nov 14, 2008
Posts: 14
posted
0
Thanks the script works fine in IE but it wont work in FireFox.
Its showing me this error:
ActiveXObject is not defined var word=new ActiveXObject('Word.Application'); Could you please provide me the solution for this.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
9
posted
0
Like I said, ActiveXObject only works in IE.
shalu pareek
Greenhorn
Joined: Nov 14, 2008
Posts: 14
posted
0
do you any remedy for that . Wht else i can use so as to open a document in the server to the client side. Is there any other method in java script which will open word document.
Intead of ActiveX Control wht i can use?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
9
posted
0
Originally posted by Ulf Dittmer: Why not just link to the document, and let the user decide what to do with it (open it with some application, or save it to disk)?
shalu pareek
Greenhorn
Joined: Nov 14, 2008
Posts: 14
posted
0
Hi, My requirement is to open the doc at server side in MSoffice only. Basically wht i am trying to achieve over here is to launch MSOffice at the cleint side frm my appliaction. I am wroking in Content mangagemenet. So once the doc had been opened i need to save back changes which user had made to the server also. Tht will be later requirement. WE are using XA which is MSoffice plugin to open xml doc. So basically i have to open MSOffice. Please let me how to do that. I dnt understand how we can just provide a link to the doc and let user to decide to open tht.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
9
posted
0
I dnt understand how we can just provide a link to the doc and let user to decide to open tht.
That's simple: <a href="my-word-file.doc">my Word document</a>
If the user clicks on that, she will be prompted what to do with it - open it (with a choice of which application to use), or save it to disk. In that dialog is an option to let the user specify that Word documents should always be opened by a particular application; if chosen, the dialog will then never be shown again.