Thursday, January 27, 2011

How To Make SharePoint 2003 Play Nice With Office 2007 Files

Office 2007 and SharePoint 2003, How To Fix Icons and File Open Issues
After digging around more than a dozen websites to get my own SharePoint site accepting Office 2007 files (docx, pptx, etc) as Word and PowerPoint files and not zip files I thought I’d try to bring all the info into one place for easy reference.
As you may of have not noticed if you’re using SharePoint 2003 and Office 2007 and save your documents to SharePoint you never see the correct icon and if you try to open the file from SharePoint it now thinks the file is a zip file. You can work around this by ignoring the icon and doing the little "Drop Down" and say "Edit in Word" but just because Microsoft has released SharePoint 2007 that doesn’t mean you have to do work arounds just to get your own site to work with Office 2007.
Since we are going to be working with IIS let’s go ahead and stop it, ‘net stop iisadmin’.
So first off let’s get the icons we need. A big shout out to Alexander for creating those icons for us. Just open the zip, grab the icons from the "gif-light" directory, copy them into ‘%program directory%\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\IMAGES’. Now just edit the XML file which loads those icons by going to, ‘%program directory\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\XML’, open "docicon.xml" with Notepad. ALERT: For me any time I start messing with windows files I expect Murphy to show up so do yourself a favor and before you edit this and other files do a right-click, send to, compressed file just in case. Locate the section section and add the following keeping your formatting inline for easy reference and nice XML:

















Now that we have the icons and SharePoint knows how to assign them let’s move on to getting IIS to understand that a .docx file should be opened by Word instead of Zip. This also is pretty straight forward once you either know IIS and knew immediately the problem was a mime type association or you keep reading and just let me tell you how to fix this. Basically the problem is IIS doesn’t know how to serve up these file extensions so we need to tell it how by adding the mime type associations. Since we stopped IIS earlier it’s just a matter of editing the XML file containing the extensions which is ‘MetaBase.XML’ located at, %Windows%\system32\inetsrv. What we need to do is add the following to the IIsMimeMap section. Again keep the formatting pretty and do the ‘send to compressed’ just in case. Also note there is a leading and trailing " in that section so be careful how you paste and edit :
.docm,application/vnd.ms-word.document.macroEnabled.12
.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotm,application/vnd.ms-word.template.macroEnabled.12
.dotx,application/vnd.openxmlformats-officedocument.wordprocessingml.template
.potm,application/vnd.ms-powerpoint.template.macroEnabled.12
.potx,application/vnd.openxmlformats-officedocument.presentationml.template
.ppam,application/vnd.ms-powerpoint.addin.macroEnabled.12
.ppsm,application/vnd.ms-powerpoint.slideshow.macroEnabled.12
.ppsx,application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptm,application/vnd.ms-powerpoint.presentation.macroEnabled.12
.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation
.xlam,application/vnd.ms-excel.addin.macroEnabled.12
.xlsb,application/vnd.ms-excel.sheet.binary.macroEnabled.12
.xlsm,application/vnd.ms-excel.sheet.macroEnabled.12
.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltm,application/vnd.ms-excel.template.macroEnabled.12
.xltx,application/vnd.openxmlformats-officedocument.spreadsheetml.template

Now just start IIS back up, simple way for that is to do an ‘IISReset’ at the command prompt and go test SharePoint. If you have followed the above correctly and not made any editing mistakes to the XML files you should be good to go.

No comments:

Post a Comment