The Office Open XML file cannot be opened because there are problems with the contents.

Learn what steps to take to avoid getting a Word 2007 error that tells you that the file is corrupt when you have manually modified the DOCX file by unzipping it.

A common trick to accessing the files stored in a DOCX file, is to change the file extension of the DOCX file from DOCX to ZIP.

In preparation for an article that I’ll soon publish about writing the contents of an InfoPath field to a DOCX file, While preparing an article on converting the contents of a Rich Text Box field on an InfoPath form and displaying it in a Word 2007 document, I accidentally came across the following error when I tried to modify a DOCX file outside of the Word 2007 environment and then open it in Word 2007:

The Office Open XML file <filename> cannot be opened because there are problems with the contents.

Details
The file is corrupt and cannot be opened.

While this error can have several causes, it took place when I did the following:

  1. Change the file extension of the DOCX file from DOCX to ZIP.
  2. Unzip the ZIP file and store the contents in an unzipped folder.
  3. Optionally, make modifications to the files in the unzipped folder.
  4. Use the zip functionality in Windows to zip the unzipped folder back up and create a ZIP file.
  5. Change the file extension of the ZIP file from ZIP to DOCX.
  6. Open the DOCX file in Word 2007.

Obviously there is a special way to zip the unzipped folder back up to create a DOCX file, because Word 2007 does not accept just any ZIP format and/or compression. The way around this is to never unzip the ZIP file to a separate folder and then zip the folder back up.

To avoid getting the error above, manually change a DOCX file as follows:

  1. Change the file extension of the DOCX file from DOCX to ZIP.
  2. Double-click the ZIP file. A Window containing the folders and files within the ZIP file will open.
  3. If you need to modify any of the files within the ZIP file, drag that file out of the ZIP file and drop it somewhere on your local PC.
  4. Change whatever you need to change in the file and save the file.
  5. Drag the file back to the Window for the ZIP file and drop it in the ZIP file.
  6. Accept the prompt that asks you whether you want to replace the file.
  7. Change the file extension of the ZIP file from ZIP to DOCX.
  8. Open the DOCX file in Word 2007.
 
 Subscribe via RSS or Email

Related Posts

Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013

InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners

InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010

InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers

InfoPath 2010 Cookbook 4: 101 Code Recipes for VB Developers

InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services