Semi-Automated Powerpoint to Book Import - Free Macro

Semi-Automated Powerpoint to Book Import - Free Macro

by Brian Merritt -
Number of replies: 6
Picture of Particularly helpful Moodlers

I love sharing! I hope this helps someone (else)

With a PowerPoint Macro, it is possible to save your slides and import them directly into Moodle Book using Import Chapter.

Attached is the Macro Code, and below you can see step by step how to do it.  Note - This works on PowerPoint 2010 and should work for 2007 but not tested.

0. Load PowerPoint and the PPT file you want to Import into Moodle

1. Now, get Macros enabled on your PowerPoint (You need to see the Developer Tab). You might need admin support for this

2. Click on the Macros button, enter any Macro name (macro999), then click edit

3. Delete any code in the Macro already, and paste in the Macro in the attached file.  For safety sake, you should always check any foreign Macro to make sure it isn't doing anything weird - this one doesn't but check it anyway smile  ps - never edit the macro using Word, or it will mess up the quotes.  Use notepad or notepad++

4. Before you run the macro, make sure you select the Tools tab, and References.  Make sure you have Visual Basic for Applications, Microsoft PowerPoint nn.n Object Library, OLE Automation, and Microsoft Office nn.n Object Library enabled.  ps nn.n = the version number, so on my PowerPoint 2010 it is 14.0   - You only need to do steps 1 & 4 once per computer, but I think you need to do steps 2 & 3 for every presentation

5. Run the Macro - PowerPoint_ExportSlidesForMoodleBookImport

6. Select your pixel width (for example 600 or 700 or 800)

7. After the Macro completes running, there will be a folder in the same directory as the original PPT file, with the same name as the PPT file.  In that folder will be an HTML page and and .PNG image per slide.  If you just want the pictures, you are all set.  The HTML page is really only there because the Chapter Title comes from the PowerPoint slide title and Moodle needs that (saves you typing it in again!)

8. Create a Zip file, and add all the images and html sorted in Name order (that way the chapters all work fine). If you want any of the slides to be subchapters, rename the HTML files and add "_sub" to the end of the name.

9. Now go to Moodle, select the Book you want or create a new one, and select "Import Chapter", and upload the zip file.  If you get an error message saying there were no chapters to import, then you created the zip file but forgot to put the HTML and Image files into it.  

10. You now have your book imported nicely.  You can import more chapters from another powerpoint file at the end if you want.

Finally - should this be stored somewhere within Moodle that is more useful? If yes, please say where and I can include some screenshots to help (once a few people have tested this and ironed out any glitches)

All the best!

Average of ratings: Useful (4)
In reply to Brian Merritt

Re: Semi-Automated Powerpoint to Book Import - Free Macro

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hello there - I meant to come back to this earlier but didn't and I apologise for that, as I think this will be very helpful to people wanting to do this. I will download and test this out - I only have ppt 2007 but I presume that will be OK? As for your last question - where could it be stored? I am about to add this forum link to the Book FAQ smile

In reply to Mary Cooch

Re: Semi-Automated Powerpoint to Book Import - Free Macro

by Brian Merritt -
Picture of Particularly helpful Moodlers

Thanks Mary

Merry Christmas!!!

I think it will work for PPT 2007, but doubt it would work for 2003 without some mods.

Any problems, please let me know.  Especially important is enabling the appropriate tool libraries in PowerPoint.

Do you know if there is a Moodle Forum for the File Resource?  I have also created a non Javascript macro that exports Powerpoint as a series of linked HTML slides with forward and back button I would like to share with everyone.

In reply to Brian Merritt

Re: Semi-Automated Powerpoint to Book Import - Free Macro

by Bernhard Vock -

Hi,

Thank you for that. It worked brilliantly. Only problem is that neither links nor embedded YouTube videos work (i guess because each page is saved as a png and thus the links do not work).

Nevertheless, easy as...

In reply to Bernhard Vock

Re: Semi-Automated Powerpoint to Book Import - Free Macro

by Brian Merritt -
Picture of Particularly helpful Moodlers

Thanks Bernard

It does make importing books simple, and so long as most of the powerpoint pages are static it should work well.

Book Chapters can be edited, so you can add a URL or Video as needed.

All the best!

In reply to Brian Merritt

Re: Semi-Automated Powerpoint to Book Import - Free Macro

by Shawn Pichoff -

Hello - I'm here to say Thank you! - This was perfect and took a process that was at least an hour of repetitive BS and dropped it down to 2 mins. 

 Thank you.

In reply to Shawn Pichoff

Re: Semi-Automated Powerpoint to Book Import - Free Macro

by Ger Tielemans -

If you create a PPT with embedded sound and you convert that into .mp4 with powerpoint 2013

then you get a nice PPT movie which you can very easy - embed as a file (I prefer popup settings.)

(the alternative "share .PPT with a link in OneDrive" is more complex... )