Why do I get the error "The document cannot be opened because there are problems with the content"?


  • I'm not sure thsi is the right forum, but I hope I'm not barking up the wrong tree.

    So I'm new to the OpenXML world, and I decided to manualy create a very simple document as part of the learning process. When I try to open my newly created package in Word 2007, all I get is "The document cannot be opened because there are problems with the contents: The file is corrupt and cannot be opened". The OpenXML SDK v2.0 but it crashes when I try to open my document. 

    What I've done is manually create the /[content_types].xml, /document.xml and /_rels/.rels files (I tried using VIM, Notepad and Notepad++). 

    ZIP all files together (using the windows shell, and 7zip), and changed the extension to .docx 

    I suspected an incorrect encoding but I made sure Notepad++ was using UTF-8 to match the description in the xml files. 

    I've been trying to figure out the problem since yesterday, with no success. I'd apreciate any pointers or sugestions. 

    If anyone is interested, I've uploaded a one of my test packages in . In case it helps, here's the code used in my files: 

    ** /document.xml ** 
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <w:document xmlns:w="">
            <w:t>Hello World</w:t>

    ** /[Content_Types].xml ** 
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Types xmlns="">
      <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
      <Default Extension="xml" ContentType="application/xml" />
      <Override PartName="/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.mainxml" />

    ** /_rels/.rels ** 
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Relationships xmlns="">
      <Relationship Id="rId1" Type="" Target="document.xml" />
    I know it's extremely simple, yet I can't get the file to open :S Any advice would be extremely helpful.

    Thanks for reading :D

    Wednesday, January 27, 2010 12:49 AM