问题
I have a web application(PHP) running on a server which hosts several DOCX Documents (MS Word documents)
I want the user (using my application) after choosing any document to be able to:
- open the document using Microsoft Word installed on his PC
- View the document and edit it.
- save his work, and changes must be committed to the server.
could anyone help me how to do that
ie.
- lunch MS Word on client PC from JavaScript
- know when the user closes the MS Word application on his PC
- is it necessary to download the file before editing it or I can edit it remotely?
Thanks in advance
回答1:
You can launch Office applications using Office URI Schemes. This would allow you to automatically open the file.
If you want to avoid downloading the file locally, you'll need to implement either WOPI or WebDav on your backend to handle the requests.
A simpler solution would be to use Microsoft Graph to push the file into OneDrive. Files in OneDrive have a WebUrl
property which wires up opening documents in Office for you.
来源:https://stackoverflow.com/questions/43557763/launch-ms-word-on-client-pc-to-edit-document-on-server