Days
Hours
Minutes
Seconds
x

New Froala Editor v5.0.0 is here – Learn More

Skip to content
Froala Documentation

Export to Word Plugin

Plugins are fully functional during your trial once you've added your trial key to the setup.

The Export to Word plugin enables users to export the editor’s content directly into a Microsoft Word (.docx) file. This feature is especially useful for scenarios where content needs to be shared, printed, or archived in a widely accepted document format.


Plugin options:

wordExportFileName
String
Specifies the name of the file to be exported. The plugin automatically handles the file extension, so only the base name needs to be provided.
Default: 'NameOfTheFile'

Plugin events:

word.beforeExport (editorHtml) This event is triggered just before the export process begins. The editor’s HTML content is passed to the callback, allowing you to modify or inspect it before export.
● editorHtml - The HTML content of the editor prior to export.
word.afterExport (editorHtml) This event is triggered after the export process is completed. The exported HTML content of the editor is available through the callback.
● editorHtml - The HTML content of the editor at the time of export.

Dependence

For the plugin to work properly, you need to include the file-saver and html-docx libraries in your project.

  • If you're working in a browser environment, you can include them via CDN.
  • For Node.js or bundler environments, you can install them via npm
  <script src="https://cdn.jsdelivr.net/npm/file-saver-es@2.0.5/dist/FileSaver.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/html-docx-js@0.3.1/dist/html-docx.min.js"></script>

Add Plugin to your code:

Plugin name: exportToWord

Plugin JS Script: ../js/plugins/export_to_word.min.js

Or from CDN https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/export_to_word.min.js

Plugin CSS link: _

Sign up

Download the code by signing up for our newsletter

Sign up

Download the code by signing up for our newsletter

Note: By registering, you confirm that you agree to the processing of your personal data by Froala, Inc. - Froala as described in the Privacy Statement. Froala, Inc. - Froala is part of the Idera group and may share your information with its parent company Idera, Inc., and its affiliates. For further details on how your data is used, stored, and shared, please review our Privacy Statement.