Some test text!

Search
Hamburger Icon

Web / Guides / Edit MS Office file

Create and edit Word (DOCX) using Javascript

Create and edit DOCX without any server-side dependencies. WebViewer enables MS Office file editing without the need for intermediate format conversion or MS Office installations on your server.

JS DOCX Editor

If you have a URL for a document, you can pass it to the WebViewer constructor or loadDocument function to open it.

Sample for editing Word (DOCX) files in WebViewer
Full sample code shows how to call WebViewer constructor to instantiate and load a document. You can load local/remote files of your choice.

WebViewer constructor

Load the office document with the WebViewer constructor and it will load with the Viewer.

WebViewer({
  ...,
  initialDoc: 'https://myserver.com/myfile.docx',
  enableOfficeEditing: true,
}, document.getElementById('viewer'));

Load document

Load the office document with the load document method after WebViewer is initalized.

WebViewer(...)
  .then(instance => {
    instance.UI.loadDocument(
      'https://myserver.com/myfile.docx',
      {
        filename: 'myfile.docx',
        enableOfficeEditing: true,
      });
  });

Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales