Moodle and MS Office 2007: not working properly

Moodle and MS Office 2007: not working properly

by Ghassan Geara -
Number of replies: 24
Hi!

When we "Link to a file" any MS Office 2003 (.xls / .doc / .ppt), all works fine on our Moodle 1.6.4. You can see the related icon and it can open either inside the frame or in a new window.

Things are not working the same when linking to an MS Office 2007 file.
The icon in Moodle is the [html] icon in the course topics and an [interrogation mark] in the course storage area. When clicking on it, it either allows for a "Save/cancel" (if Office 2007 is not installed on the PC) or an "Open/Save/Cancel" of Office 07 is installed, but no correspondant icons next to the resource link in the course topics.

Any suggestion how to make Office 2007 files work exactly as Office 2003 in Moodle? Any update/plugin/files needed on the Moodle server side?

Thanks
Ghassan
Average of ratings: -
In reply to Ghassan Geara

Re: Moodle and MS Office 2007: not working properly

by Jeff Wood -
Ghassan,

You might want to check to see what format your Office files are being saved in. MSOffice 2007 has introduced a new file format (Word now docx) and it saves files in this new format by default.

Try doing a "save as" in Office 2007 can choose the "Word 97-2003 Document"

Jeff
In reply to Jeff Wood

Re: Moodle and MS Office 2007: not working properly

by Ghassan Geara -
Jeff,

Yeah, the "save as" works fine but we want docx/xlsx/... to work properly as well. We cannot tell instructors using on a campus wide more and more Office 2007 to "save as" to Office 2003!

There should be a way to make both Office 2003 and 2007 work properly in Moodle.

Thx for ur reply
G
In reply to Ghassan Geara

Re: Moodle and MS Office 2007: not working properly

by Jeff Wood -
Also wonder if on the server side (Mime types) things need to be changed?!

Jeff

PS

Just added a custom Mime Type

application/msword with extension docx

FF opens it in Word, but moodle displays the website link icon.
In reply to Jeff Wood

Re: Moodle and MS Office 2007: not working properly

by Geoffrey Rowland -
Picture of Plugin developers

I'm not an expert in this, but suspect you may need to add entries for the new file types to the function get_mimetypes_array() in /lib/filelib.php

e.g. after the entry

'doc' => array ('type'=>'application/msword', 'icon'=>'word.gif'),

add a new entry

'docx' => array ('type'=>'application/msword', 'icon'=>'word.gif'),

and similarly for the other Office 2007 file formats

I have not yet tested this, as we are still on Office 2003, but it is is worth a try. If it works, perhaps post the fix to the Moodle bug tracker as I expect we'll all be upgrading to Office 2007 eventually...

In reply to Geoffrey Rowland

Re: Moodle and MS Office 2007: not working properly

by Ghassan Geara -
Thx Geoffrey,

I'll forward these code lines to the system admin in charge of hacking Moodle code for testing.

The code suggested directs 'docx' and 'doc' to the same application 'msword', what will happen if both Word 03 & 07 are both installed?
I guess we must have new apps names for Office 2007 extensions. 'msword' should remain for MS Word 03. 'msword07' can be created for Word 07, same for Excel: 'msexcel' AND 'msexcel07' both available, etc.. What do u think?

G
In reply to Ghassan Geara

Re: Moodle and MS Office 2007: not working properly

by Geoffrey Rowland -
Picture of Plugin developers

Gassan

The changes to filelib.php, perhaps combined with Jeff's suggestion of updating the web-server (e.g. Apache) mime configuration, should sort things on the Moodle server-side.

If you are desperate to give users a different icon for Office 2007 files, change the appropriate icon name in filelib. php and place a .gif file with the same name in /pix/f/ on your Moodle server. For some themes, you may have to add the icon to those as well. Personally, I would be inclined to keep things simple for your end-users and just keep the standard Moodle icon types.

Whether this all works for end-users will depend on their local configurations. Office 2007 should just work with, say, .docx or .doc format. Earlier versions will only work with .doc, unless the Microsoft Office Compatibility Pack has been installed (manually or through Windows update/Service Packs).

Hope this helps

Geoff

In reply to Geoffrey Rowland

Re: Moodle and MS Office 2007: not working properly

by Ghassan Geara -

Hi Geoff,

Your code works! I tested .docx/.doc on a PC with both Office 03/07 installed.

Both documents opened in Ms.Word 2007 in a new window (same frame or not, it starts the corresponding application...seems it can't find a viewer to open it inside the IE frame. (tested in IE 6.x).

My question, what to do with the other extensions? 

Word 2007 File Type Extension

Word 2007 XML Document

.docx

Word 2007 XML Macro-Enabled Document

.docm

Word 2007 XML Template

.dotx

Word 2007 XML Macro-Enabled Template

.dotm

Excel 2007 File Type Extension

Excel 2007 XML Workbook

.xlsx

Excel 2007 XML Macro-Enabled Workbook

.xlsm

Excel 2007 XML Template

.xltx

Excel 2007 XML Macro-Enabled Template

.xltm

Excel 2007 Binary Workbook

.xlsb

Excel 2007 XML Macro-Enabled Add-In

.xlam

PowerPoint 2007 File Type Extension

PowerPoint 2007 XML Presentation

.pptx

PowerPoint 2007 Macro-Enabled XML Presentation

.pptm

PowerPoint 2007 XML Template

.potx

PowerPoint 2007 Macro-Enabled XML Template

.potm

PowerPoint 2007 Macro-Enabled XML Add-In

.ppam

PowerPoint 2007 XML Show

.ppsx

PowerPoint 2007 Macro-Enabled XML Show

.ppsm

Should we add a line for EACH extension here?
Martin D, HEEEEELP! wink Any roadmap/strategy that defines how Moodle will deal with all these Office 2007 XML extensions? 

In reply to Ghassan Geara

Re: Moodle and MS Office 2007: not working properly

by Geoffrey Rowland -
Picture of Plugin developers

Ghassan

Glad it works for you. I was only expecting to use additional lines for the 'standard' Word, Excel and Powerpoint file types to /lib/filelib.php

ie:

'docx' => array ('type'=>'application/msword', 'icon'=>'word.gif'),

'pptx' => array ('type'=>'application/vnd.ms-powerpoint', 'icon'=>'powerpoint.gif'),

'xlsx' => array ('type'=>'application/vnd.ms-excel', 'icon'=>'excel.gif'),

However, if you require the templates or macro-enabled formats too, you could add further similar entries for these.

I will add this to the Moodle issue tracker (linking to this thread), so it will hopefully be addressed in the near future.

Geoff

PS now added to the bug tracker at: http://tracker.moodle.org/browse/MDL-9940

In reply to Geoffrey Rowland

Re: Moodle and MS Office 2007: not working properly

by Geoffrey Rowland -
Picture of Plugin developers
A brief follow up. You can get icons for the new Office 2007 File Types from here

So, if it is important for you to distinguish these new types (and I'm not really sure about the value of this), you could upload them (the .gif versions) to /pix/f/ on your moodle server and edit the appropriate entry in /lib/filelib/.

Also, having Googled around a bit more, I have discovered the full mime types for the new office formats

http://www.vladville.com/2007/04/office-2007-mime-types-for-apache.html






In reply to Geoffrey Rowland

Re: Moodle and MS Office 2007: not working properly

by aras kumar -

Dear Ghassan,

As u have said in filelib.php there is already an entry for 'pptx.

But iam facing a message 'pptx is not an allowed extension for indexing' in the Global search module.

I even tried of adding 'pptx' in the $defaultfiletypes' of config_global.html. The same condition prevails.

How to get the pptx files get indexed.

Thanks,

Aras

In reply to Jeff Wood

Re: Moodle and MS Office 2007: not working properly

by Chris Lamb -

Presumably Moodle spots the .doc, .xls, etc extensions and puts the right icon in for it, but doesn't recognise the .docx extension, hence the problem.

Might be worth raising it as a bug report or feature request so the developers can add a bit of code to catch the .---x extensions as well.

Chris

In reply to Chris Lamb

Re: Moodle and MS Office 2007: not working properly

by Ghassan Geara -
Yes, Moodle should spot the new Office 07 extensions (docx, xlsx, ...) differently and search for the correspondant application, while keeping backward compatibility for Office 03.

For many instructors here, we can find on their PCs Office 2003 installed next to Office 2007.

I hope Moodle will treat Office 2007 as new apps with their own extensions and add their new icons so we don't mess up the Office 03 files/extensions/icons.
In reply to Ghassan Geara

New icons and mime file array for Office 2007

by Roger Emery -

if it helps anyone, here is an updated lib/filelib.php file and updated pix/f/ folder of newer icon files such that the old icon is shown for office 2003 and before and the new icons are shown for office 2007 docx etc.

Roger

In reply to Roger Emery

Re: New icons and mime file array for Office 2007

by Geoffrey Rowland -
Picture of Plugin developers

Roger

Thanks for this. I have added it to the relevant Moodle bug tracker entry

http://tracker.moodle.org/browse/MDL-9940

Geoff

In reply to Geoffrey Rowland

Re: New icons and mime file array for Office 2007

by A. T. Wyatt -
Thanks! I voted for it!

atw
In reply to A. T. Wyatt

Re: New icons and mime file array for Office 2007

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Fixed! wink
In reply to Martin Dougiamas

Re: New icons and mime file array for Office 2007

by Haruhiko Okumura -
This is by no means fixed; it is broken.

If you supply the same mime type 'application/msword' to docx, some server/browser combinations may convert file names such as foo.docx to foo.docx.doc. You may encounter other troubles.

Please read this page carefully, and set the appropriate mime types.

Also, this page shows giving ppt and pps the same mime-type can cause trouble.
In reply to Roger Emery

Re: New icons and mime file array for Office 2007

by Elizabeth Lewis -

I did copy down these files and now files are attached to the correct icons.  However, I must have missed something because I still cannot directly open Office 2007 files with the current fixes in place.  (I have to download first.)

I am getting the attached error message.  We are using version 1.7+.

Attachment error_message.jpg
In reply to Elizabeth Lewis

Re: New icons and mime file array for Office 2007

by Keyser Söze -
I get the same type of error message on both 1.82 and 1.83 so I don't see how this is resolved.  None of our faculty or students either on  or off campus can open the new .pptx filetype.
In reply to Ghassan Geara

Re: Moodle and MS Office 2007: not working properly

by William Peterson -

I'm strongly agree with the idea of converting PowerPoint to Flash to solve PowerPoint compatibility issue. Flash can be easily embedded in Web pages for Moodle and be widely supported by most Web browsers. You can view your PowerPoint 2007 slide shows in any platform.

OpenOffice can export ppt files to swf, but it's not compatible with PowerPoint 2007 so far. And if you export your ppt files to swf files in OpenOffice, most effects, transitions, animatios and sounds are lost, neither the beautiful SmartArt in PowerPoint 2007.

In my search of "PowerPoint 2007 to Flash": http://www.google.com/search?hl=en&q=PowerPoint+2007+to+Flash, I find only one PowerPoint to Flash conversion tool which really supports PowerPoint 2007 with SCORM/AICC compliance for LMS. It's Wondershare PPT2Flash Professional, learn more at http://www.sameshow.com/powerpoint-to-flash-pro.html, or download trial version: http://download.sameshow.com/ppt2flash_trial.exe.

I think you'll like it. Have fun smile

In reply to William Peterson

Re: Moodle and MS Office 2007: not working properly

by Steve Wilson -
Wow! Great tip Thanks William!

I will be using power points on my site to demonstrate how to use some equipment. This would be an ideal solution as messing around with ptt's has given me a headache trying to get them to work 'out of the box' within moodle.
I will make some of these demos available shortly, hopefully not loosing to many effects. They can be seen at www.hydro-supplies.co.uk If anyone would like to comment on them?

Steve
In reply to Steve Wilson

Re: Moodle and MS Office 2007: not working properly

by Mark Oxley -
I've been assigned the job of putting employee training ppt's on our moodle, at www.turnerlittle.com/moodle , and have had to resort to flash conversion for the same reasons. When will this be fixed? I'm hoping in 2.0, as that will save me from the conversion process every time we have a new vid...

M
In reply to Ghassan Geara

Re: Moodle and MS Office 2007: not working properly

by Aaron NA -

I know this might be an older dead thread, but I had to run through the same issues on Moodle 1.9.2 where DOCX files still downloaded as .DOC and opened in Word 2003. Our machines run both Office 2003 and Office 2007, so I've documented how to resolve this issue in another thread that I started because all of these responses did not cure our issue.

http://moodle.org/mod/forum/discuss.php?d=102716