locked
How to prevent Sharepoint 2007 from adding Custom XML to Office 2007 documents RRS feed

  • Question

  • When I upload an Office 2007 document to Sharepoint, its metadata is modified. Here is what I found:

    Original file:

     

    filename - docProps/app.xml
    
    filename - docProps/core.xml
    
    filename - xl/worksheets/sheet1.xml
    
    filename - xl/styles.xml
    
    filename - xl/sharedStrings.xml
    
    filename - xl/worksheets/sheet3.xml
    
    filename - xl/worksheets/sheet2.xml
    
    filename - xl/theme/theme1.xml
    
    filename - xl/workbook.xml
    
    filename - xl/_rels/workbook.xml.rels
    
    filename - _rels/.rels
    
    filename - [Content_Types].xml
    
    mimetype - application/zip
    

     

    File in Sharepoint:

     

     

    filename - customXml/_rels/item3.xml.rels
    
    filename - docProps/custom.xml
    
    filename - customXml/itemProps3.xml
    
    filename - customXml/item3.xml
    
    filename - customXml/_rels/item2.xml.rels
    
    filename - customXml/itemProps1.xml
    
    filename - customXml/item2.xml
    
    filename - customXml/itemProps2.xml
    
    filename - customXml/_rels/item1.xml.rels
    
    filename - customXml/item1.xml
    
    filename - docProps/app.xml
    
    filename - docProps/core.xml
    
    filename - xl/worksheets/sheet1.xml
    
    filename - xl/styles.xml
    
    filename - xl/sharedStrings.xml
    
    filename - xl/worksheets/sheet3.xml
    
    filename - xl/worksheets/sheet2.xml
    
    filename - xl/theme/theme1.xml
    
    filename - xl/workbook.xml
    
    filename - xl/_rels/workbook.xml.rels
    
    filename - _rels/.rels
    
    filename - [Content_Types].xml
    
    mimetype - application/zip
    
    
    

    This causes problems when I try to open these files in OpenOffice. Is there a way to prevent Sharepoint from adding CustomXml and store the original files as-is?
    I'd appreciate your thoughts on this. Thanks.

     

     

    • Moved by Lily Wu Wednesday, November 24, 2010 12:48 AM MOSS 2007 issue (From:SharePoint 2010 - Setup, Upgrade, Administration and Operation)
    Tuesday, November 23, 2010 10:01 PM

Answers

  • A few years back I had to implement a similar requirement to prevent SharePoint from making certain changes to office document metadata. The solution I found was implemented programmatically by setting the ParserEnabled property on an SPWeb object to FALSE.

    using(SPSite oSite = new SPSite("http://yoursharepointsite"))
    {
      using(SPWeb oWeb = oSite.OpenWeb())
      {
       oWeb.ParserEnabled = false;
       oWeb.Update();
      }
    
    }
    

    This would need to be done for each web (sub-site) in the site collection. I think you can also update this value using the free SharePoint 2007 Manager tool from Microsoft.

    If this solution works, I would caution you to test it thoroughly as I recall it having some undesired side-effects. The biggest ones I can remember are that it breaks site/list templates, and prevents the property promotion/demotion feature for Office 2007+ documents.

    • Proposed as answer by Wade A. Hunter Thursday, November 25, 2010 4:25 PM
    • Unproposed as answer by Mike Walsh FIN Thursday, November 25, 2010 4:40 PM
    • Marked as answer by David HM Thursday, December 2, 2010 7:21 AM
    Thursday, November 25, 2010 4:25 PM

All replies

  • A few years back I had to implement a similar requirement to prevent SharePoint from making certain changes to office document metadata. The solution I found was implemented programmatically by setting the ParserEnabled property on an SPWeb object to FALSE.

    using(SPSite oSite = new SPSite("http://yoursharepointsite"))
    {
      using(SPWeb oWeb = oSite.OpenWeb())
      {
       oWeb.ParserEnabled = false;
       oWeb.Update();
      }
    
    }
    

    This would need to be done for each web (sub-site) in the site collection. I think you can also update this value using the free SharePoint 2007 Manager tool from Microsoft.

    If this solution works, I would caution you to test it thoroughly as I recall it having some undesired side-effects. The biggest ones I can remember are that it breaks site/list templates, and prevents the property promotion/demotion feature for Office 2007+ documents.

    • Proposed as answer by Wade A. Hunter Thursday, November 25, 2010 4:25 PM
    • Unproposed as answer by Mike Walsh FIN Thursday, November 25, 2010 4:40 PM
    • Marked as answer by David HM Thursday, December 2, 2010 7:21 AM
    Thursday, November 25, 2010 4:25 PM
  • Wade A Hunter:

    As a newcomer to the forums you have just made a newcomer's mistake.

    The "propose as answer" function is only to be used to propose the good answers of other people. It is not - as many newcomers before you have thought so you are not alone - to be used to propose your own posts.

    I hope that you'll bear this in mind in future. Moderators are happy when people propose the good answers of other people. They are not happy with self-proposers.

    (Moderator)

     


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Thursday, November 25, 2010 4:43 PM
  • Ok, thanks. I was actually just curious to see if it would let me. I figured that option would be disabled for my own posts, much like how the "Vote as Helpful" option is disabled for my own posts.


    Wade Hunter MCP/MCTS - WSS 3.0, MOSS 2007, SharePoint 2010
    Thursday, November 25, 2010 4:49 PM
  • >  I figured that option would be disabled for my own posts,

    It ought to be !  But the (MS) forum software people seem surprisingly unwilling to incorporate such a block in the software. (They have been asked to do so often in the Suggestions for the Forums (and Forum Problems) forums.)

    Thanks.

    Mike

     


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Thursday, November 25, 2010 5:02 PM