0

Requirements:

I uploaded a file onto the server from my web application, now upon download, the browser shall launch MS Word and open that file in it. Once I make changes and save the file, it should again be uploaded automatically.

Problems: How to launch MS Word from browser? When the browser launches MS Word, how to open that specific downloaded file in MS Word? Once its open, changes are made, now on save how it will be automatically uploaded?

theMAMs
  • 83
  • 2
  • 13
  • 1
    You can't force the browser to open any application, or to upload any files after they are saved. That would violate all the security that browsers provide. – TotallyNewb Jun 10 '20 at 11:05
  • So what would be the approach i should use? Embed an editor inside my webpage? Are there any open source editor? I need this functionality for preparing basic letters with signature and stamp as an image at the end of the document. – theMAMs Jun 10 '20 at 17:10

1 Answers1

0

The best what you can do is to display a Word document on the ASP.NET page for editing and then saving it back. See Editing word documents in a web page for more information.

Note, you are free to use the Open XML SDK, see Getting started with the Open XML SDK 2.5 for Office.

You can automate Word using JavaScript only from Internet Explorer and Windows. That is because only IE knows about COM technology which makes sense only on Windows. Read more about that on the Using JavaScript to “Create” a Microsoft Word Document page.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45