Moodle plugins directory: Microsoft Word File Import/Export (Book) | Moodle.org
Microsoft Word File Import/Export (Book)
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. Note that files in.docm format (i.e. including macros) are not supported.
Both GoogleDocs and 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 on editing in an existing book, to see this 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 exported file must be opened first using Microsoft Word. You can then save it to .docx format and edit it in LibreOffice or GoogleDocs. If the exported file contains images, then you must use Word 2019 or higher, or Word 365 (web version) , in order for images to be opened correctly.
I then tried using a MS Word 2007 docx copy of the same file. It failed with the same two debug messages and then had additional info, "Can not read file, either file does not exist or there are permission problems
More information about this error", followed by some more debug info,a stack trace, and a Continue button. Clicking continue takes me back to the Moodle front page, and upon checking, the book is still empty.
Since I can't put pictures of the debug output here, let me know if you would like me to, and I will try to add them at the github source page.
I saved the text as txt, then opened it in MS Word. I then formatted H1 and H2 as needed and saved as docx. I was then able to successfully import the file. With debugging on I still get some debug information about pass 1 and pass 2, but I also now get the Importing and Relinking message followed by a continue button. The book looks as it should.
I have not tried this with any pictures yet.
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.
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.
Thank you very much for your efforts.
Best regards.
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.
Thanks,
Marco
Please give correct attribution / credit for Lucimoo to Mikael Ylikoski - http://lucidor.org/lucimoo/ on your page https://github.com/ecampbell/moodle-booktool_wordimport
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 (pascal.gagnebin@ceff.ch) if you want I send you the Word files.
Best regards,
Pascal
The exported Word file needs some post-processing if the book contains images. You need to download a Word template from http://www.moodle2word.net/ 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.