Hi All,
Topic: Edit Word Document at client side and update back to server side application
I have a desktop application i.e. server- client app (not web) 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
- 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

Guest UserRank #1,654 · 929 reputationPosted Nov 10, 2020, 11:16 PM EST
Marvin ReidRank #1,963 · 746 reputationPosted Oct 25, 2022, 11:41 AM EDT
You can use the Document Editor to programatically open your Word documents, view, edit, and then save the changes to an output file which can be stored on your server.Here is some code that demonstrates this:
addImage = () => { // Load file //Allows the user to input an image of their choosing for the specific file types allowed at the cursor location var input = document.createElement('input'); input.type = 'file'; input.style.display = 'none'; input.accept = '.png, .docx, .doc, .jpg, .pdf'; input.onchange = function (e) { var files = input.files; if (!files || !files.length) return; file = files[0]; var url = URL.createObjectURL(file); editor.engine.images.insertImage(url); }; input.click(); } updateStyle = () => { //Edit something in the file //Allows the user to select from 3 different styling for the image they currently have selected var value: number = null; var input: string = prompt("Which image style would you like? (input the number corresponding to the style, default is Wrap Text)\n\n1. Inline\n2. Break Text\n3. Wrap Text"); if (input == '1') { value = 0; } else if (input == '2') { value = 1; } else { value = 2; } editor.engine.images.updateImageStyle(value); } exportAsDoc = () => { // Export changes to Docx file //exports the current document for saving var promise = editor.document.toFile("untitled", lt.Document.Writer.DocumentFormat.Docx); var err = null; promise.then(function (name: string) { }); promise.catch(function (err: string) { alert("There was an issue exporting the document. " + err); }); }https://www.leadtools.com/help/sdk/v22/dh/javascript/de/imageengine.html
https://demo.leadtools.com/JavaScript/DocumentEditor/