Book tools: Microsoft Word File Import/Export (Book)

Maintained by Picture of Eoin CampbellEoin Campbell
Import the contents of a '.docx' format file into a book, splitting it into chapters and (optionally) subchapters, based on the heading styles. The file can be from either Microsoft Word or LibreOffice. Also supports exporting books to Word format, for round-trip editing.
2491 sites
89 fans
Current versions available: 2

This plugin supports importing a Microsoft Word docx-formatted file as chapters to a book. The file is split into chapters and subchapters based on the built-in heading styles "Heading 1" and "Heading 2" in Word. Embedded images are also imported if they are in web-compatible format (GIF, PNG, JPEG).

It imports .docx files only, not the older .doc format. The following Word versions support this format: Word 2007, Word 2010 and Word 2013 (on Windows); Word 2011 and Word 2016 (on MacOS). Note that files in.docm format (i.e. including macros) are not supported.

LibreOffice 5.x can also save files in .docx format, and they will import too, but generally the quality is not as good as those files saved from the native Word editor, even if the document uses the same built-in "Heading 1" and "Heading 2" styles well. Your mileage may vary.

Note also that the PHP XSL extension must be enabled on your webserver, and the plugin requires Moodle 2.7 or higher.

After installation, the Book administration menu should have a new item added, similar to the screenshot below. You must create a new book, or turn editing an existing book on, in order to see this menu.

Book administration menu

The plugin can also be used to export books, or chapters from books, back into Word .doc format. In general heading elements in HTML are converted back into corresponding heading styles in Word, and so on with other styles. The goal is to make books that are round-trip editable in Word, although it is not quite there yet. 


This plugin is part of set Microsoft Word file import/export.


Screenshot #0


Picture of Eoin Campbell
Eoin Campbell (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Eoin Campbell
    Wed, Feb 7, 2018, 11:21 PM
    Hi Tamar,
    An exported book opened in Word will never look like the original Moodle Book. All Moodle books have the look of the theme applied to your course or site, applied via CSS styles. The Word files don't have access to these styles, so they look like ordinary Word documents. However, if you re-import the Word file back in to a Moodle Book, then the content will look as you expect again.

    If your Book has images, then you need to download a special Word template to convert the images into Word format. The template is available online at Unfortunately, this template contains VBA macros, and these macros trigger warnings on some virus-checking applications, and also on Windows Defender on Windows 10. To download and use it, you will have to turn off Windows Defender, and ignore any warnings.
  • Picture of Sam Mudle
    Sat, Jun 16, 2018, 2:22 AM
    I understand that the import process will convert everything to the same font. Is there anyway of getting the importer to recognize some parts should be PREFORMATTED? That would be awesome since my books have many snippets of code that should be in a monospaced font.
  • Picture of Eoin Campbell
    Sat, Jun 16, 2018, 6:14 PM
    Use the “Macro Text” style in Word to create pre-formatted text in HTML. Use spaces, not tabs, for indentation, because tab spacing is lost in HTML. It might also be better to separate each line with a hard return using the + key, as paragraph spacing might be too large.
  • Picture of Sam Mudle
    Mon, Jun 18, 2018, 11:52 PM
    Hi Eoin,
    I have the MoodleBook Word plugin. I'm not sure where the "Macro Text" style is on that. Is this "HTML Text"?
  • Picture of Eoin Campbell
    Tue, Jun 19, 2018, 12:39 AM
    "hard return using the + key" should be "hard return using the <Shift>+<Return> key" above
  • Picture of Eoin Campbell
    Tue, Jun 19, 2018, 12:44 AM
    The "Macro Text" style is not available directly in the MoodleBook Ribbon. To get it, type <Ctrl>+<Shift>+S to open the "Apply Styles" dialog box, then type in "Macro Text in the "Style Name:" field. You can probably add this style to your Styles area if you use it a lot, or else create a shortcut key for it.
  • Picture of Sam Mudle
    Thu, Jun 21, 2018, 12:18 AM
    Thanks Eoin! That did the trick!
  • Picture of John Henderson
    Wed, Jul 11, 2018, 2:13 PM
    Hi Eoin,

    I've been trying to get the Image Converter to work on Windows 7 with Office 2016. When I run the Image converter, it appears to run for about 30-60s and ends with a notification that it's been disabled to avoid issues with Windows Defender. Windows Defender is disabled, but we are using Microsoft Security Essentials, which I did have an exception in to allow the file.

    Would you have any suggestions?

  • Picture of Eoin Campbell
    Thu, Jul 12, 2018, 5:12 AM
    The default publicly available Word template on has this function disabled, because various virus checkers believe it contains malicious code. If you register on the site and create your own account, you can download an older version that still contains this function, in the WordTable Question conversion course at Unfortunately the digital signature on both these template files has just expired, and it will take me a few weeks to get a new signature, so I think you will have to allow untrusted VBA macros to run to get it to work for the moment.
  • Picture of nic faust
    Mon, Feb 4, 2019, 8:31 PM
    Hi everyone. Thank you all for the information.
  • Picture of Shadab Uddin Mohammed
    Tue, May 14, 2019, 4:49 PM
    Is there any easy/quick solution for editing bullets and numbers to ++L and ++S, as it is taking long time for 50+ pages word files.
  • Picture of Eoin Campbell
    Tue, May 14, 2019, 5:43 PM
    I recommend using the moodleBook.dotm Word template I created that has a set of keyboard macros defined to speed up editing (cf. You need to install it in your Word Startup folder.
  • Picture of Eoin Campbell
    Tue, May 14, 2019, 10:06 PM
    See also regarding Word templates and keyboard shortcuts
  • Picture of nicholas fernando
    Thu, Feb 13, 2020, 11:35 PM
    Hi Eoin I tried to create an account on so I can get hold of the template that also converts images into word format (as per your reply to Tamar 07/02/18, but am not receiving the confirmation email to activate my account. Is there any way to get hold of the template?
1 2 3 4
Please login to post comments