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

Maintained by Picture of Eoin Campbell Eoin 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.
601 sites
40 fans
Moodle 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3

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
    Mon, 11 Jan 2016, 10:39 PM
    Hi Hakan,
    Thanks for trying it out.
    The most likely reason for this problem is that the image is placed before the first "Heading 1"
    style in the document.

    The converter only includes content after Heading 1 styles.
    Since the heading title is not included as the page name, it is also likely
    that there is no Heading 1 style in the document at all, which would also
    prevent any content from being imported.
  • Hakan Gür
    Tue, 12 Jan 2016, 1:31 AM
    Hello again,

    You are right; the image was placed right before the first "Heading 1". I corrected this and now the images are transferred together with the page. As far as this issue is concerned, I can confirm that this is not a bug. smile

    Thank you very much for your efforts.

    Best regards.
  • Picture of Marco Echavarria
    Thu, 4 Feb 2016, 10:17 PM
    Thank you for the Word import plugin.
    I think we would be using it a lot.
    I installed the Microsoft Word file import plugin, but the system looks exactly the same as before installation.
    I don't see an icon or a button in Moodle to import Word documents.
    Where can I find info about this?
    Do we need to restart the server or something?
    I am a newbie in Moodle world, so please tell me step by step, what should I need to make it work.
  • Picture of Eoin Campbell
    Fri, 5 Feb 2016, 2:58 AM
    I have added a bit to the description to make this a bit clearer. The Book Administration menu has a new item added "Import chapters from Microsoft Word file"
  • Picture of Haakon Meland Eriksen
    Thu, 17 Mar 2016, 3:31 PM
    Dear Eoin, thank you for forking Lucimoo ebook import and export and creating this new plugin - excellent! smile
    Please give correct attribution / credit for Lucimoo to Mikael Ylikoski - on your page
  • Picture of Pascal GAGNEBIN
    Wed, 6 Jul 2016, 3:36 PM
    Congratulations for this plugin, it's exactly what I need !
    I'm using Office 2013, french version.
    I encouter some little problems maybe you can solve. In a first document :
    - When a paragraph content a Word link (Référence/Renvoi), in moodle, the paragraph appear as an html link form the Word link to the end of the paragraph
    - If a paragraps content a bloc of text (Insert/Forms/Text bloc), it means the header is not correctly interpreted (appear for example as index09_06_sub.htm)
    - The "puces" (I dont't know the english term...) are not converted (ul/ol in HTML).
    In an another Word doc, none of the headers are interpreted, but styles are Heading1, heading2

    You can contact me ( if you want I send you the Word files.
    Best regards,
  • Picture of Виталий К
    Thu, 25 Aug 2016, 4:10 AM
    Hello. This plugin correctly work into Moodle 3.1?
  • Picture of Eoin Campbell
    Thu, 25 Aug 2016, 4:16 AM
    Yes, it does, and I've updated the version information to reflect this.
  • Picture of Dinis Medeiros
    Tue, 1 Nov 2016, 6:21 PM
    Hi. I'm using the plugin but one page of the Book is only one image (A4) and when i export to word the page is blanck. Is this ok?
  • Picture of Eoin Campbell
    Thu, 3 Nov 2016, 5:05 AM
    Hi Dinis,
    The exported Word file needs some post-processing if the book contains images. You need to download a Word template from that contains a macro that processes the Word file, converting the images into embedded images in Word.
    Unfortunately, this macro has recently begun to be considered by Microsoft Windows Defender to be a virus, so you may have difficulty downloading it. You would need to turn off Defender, download the template, run it on the Word file, and then turn Defender on again, in order to get the images.
    Unless you have a lot of images, it's probably easier to re-insert the image manually.
    Sorry I can't be of more assistance.
  • Picture of Derek Chaplin
    Wed, 21 Dec 2016, 11:58 PM
    I just tried the lateset version in a new install of Moodle 3.2 as well as an upgraded site and although the Word Import works great in drag and drop mode in Atto, the 3 added menu items in the Book administration menu are missing.
    I tried an exsiting Book as well as a new Book and no luck.

    Am I missing something?
    > Running under PHP 7.0
  • Picture of Eoin Campbell
    Thu, 22 Dec 2016, 1:21 AM
    I just tested on a clean install using the default Moodle 3.2 XAMPP-based distribution with the "Base" theme, and the "Book administration" menu includes the 3 extra menu items. Note that you have to create the new book, then click "Save and Display", then click on the cogwheel icon to see the Book administration menu. Are you looking for the items in the wrong place? I certainly find the new "Base" theme very confusing.
  • Picture of avi cohen
    Fri, 7 Apr 2017, 3:26 PM
    Thank you very much for this plugin. I installed it on our test - server running moodle 3.3 . I do have a few questions or requests if you can help us.
    1. when importing a docx file. footnotes are embeded into the text which causes a lot of work.
    2. headings are nor imported (from hebrew) and are stated as index00.htm index001.html ...
    3. when docx numbered, the non-numbered front page is not imported.
    I know that this plugin is good even very good but it could become better with templating & activity set in. (could be as a sub-course) .
    Again thanks for the work
  • Picture of Eoin Campbell
    Fri, 7 Apr 2017, 10:26 PM
    Hi Avi, thanks for trying out the plugin. Here are some responses.

    1. Footnotes. What would you prefer to happen: a) footnotes are silently deleted; b) footnotes are linked, and placed at the bottom of the page, or c) footnotes are embedded where they occur (in brackets)?

    2. Headings not imported properly. This problem is caused when the default formatting of the heading is overridden. If you select the entire heading, and press +, this removes all overrides, and the heading should then import properly.

    3. First section not imported. I'll take a look at this issue.

    4. Templating and Activity. I don't know what you mean here, can you explain further? (Send me a direct message).

  • Picture of avi cohen
    Sun, 9 Apr 2017, 4:29 PM
    Thank you for the swift reply , I send in a direct message.
1 2
Please login to post comments