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

    Question

  • 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 http://rapidshare.com/files/341471060/documento.docx.html . 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="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
      <w:body>
        <w:p>
          <w:r>
            <w:t>Hello World</w:t>
          </w:r>
        </w:p>
      </w:body>
    </w:document>


    ** /[Content_Types].xml ** 
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
      <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" />
    </Types>


    ** /_rels/.rels ** 
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
      <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="document.xml" />
    </Relationships>
    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

    Javier
    Wednesday, January 27, 2010 12:49 AM