Alternatives to Java applet to launch Microsoft Office applications

假装没事ソ 提交于 2020-01-11 13:01:09

问题


In our web application, we used to use a Java applet to invoke MS. Office applications e.g. Word to open, edit, and save back a file to the server.

Google Chrome will no longer support NPAPI, so soon we can not run our applet in Chrome anymore. Plus, it seems that MS. Edge is not willing to support Java.

So, any suggestions for an alternative for the Java applet. We want to make the same experience for the user, just like before: we do not want to open the files in the browser, or at least try giving the user the same experience as before, meaning a neat editor to edit/save his/her file.

I have also tried Html5 features e.g. FileSystem API. But, it turned out to me that at least that feature cannot help me. (to my knowledge, maybe I am missing something)

Summary: How to launch client applications e.g. MS. Word using Javascript/Html5 without any applets/activeX?


回答1:


From what I'm understanding is you want a way to open an a file using a specific application (MS Word?) and then when the user saves the file it is automatically updated to the server?

You can achieve this by storing the file as a temporary file and automatically checking if the file has changed every few seconds.

This can be achieved using a real-time javascript framework such as NodeJS. The application launch could be met using the following: https://msdn.microsoft.com/en-us/library/aa767914(VS.85).aspx

Or perhaps a direct <a href="file://C:/path/to/temp/word.docx">Word</a> would work.




回答2:


I know of no way to allow a web application launching local files / programs without some intervention by the user. He will as far as I know always need to accept some kind of plugin or will be prompted for some action.

There is one technique I like very much and it is relatively "lightweight": you could give your users the opportunity to either invoke Word manually or setup their computer to support a certain url handler. You can find a description of url handlers here: msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx. After this is set up your application could offer a link similar to msword://file0815.doc. You only need a small programm on the computer to react on this, the same program could combine the installer and setup function (you need some registry entries).

I have seen this in combination with DMS applications and it works quite well, uTorrent does the same for torrent downloads. Internet Explorer and Chrome support this for sure, and I am sure Firefox will too.



来源:https://stackoverflow.com/questions/30479338/alternatives-to-java-applet-to-launch-microsoft-office-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!