none
cannot open docx after inserting picture with openxml. problem with part:/word/document.xml, Line:0,Column:0 RRS feed

  • Question

  • https://social.technet.microsoft.com/Forums/office/en-US/95465d78-38fd-4c78-996a-2526d0119055/because-we-found-a-problem-with-its-contents-partworddocumentxml65292-line0column0?forum=officeitpro

    https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/cc819544(v=office.14)

    says that rsidRoot specifies the FIRST editing session. The following screenshot from me is the compare of a working docx and a "currupt" docx both originate from the same dotx. It looks like the rsidRoot point to the LAST (I mean most recent) editing session. 



    the left is from the working docx and the right is from the "currupt", its said that the order of rsid does not matter, but the working one has the most recent at the end of the list. So, does this order matter? or it's just the ordinal value of rsid HexBinaryValue instead of its position in the list that does not matter?

    And I just create a PNG file in the zip package, create relationship, and insert the RUN generated by openxml productivity tools. but when comparing "working" doc with "corrupt" doc, I see so many difference not related to the picture. when I viewpartdiff, I see its just w14:paraId changed. Why this paraId change constently?



    • Edited by GuYuming Tuesday, September 18, 2018 10:23 AM
    Tuesday, September 18, 2018 9:48 AM

All replies

  • Hi GuYuming, 

    Thanks for your question about rsidRoot in the Word document. One of the Open Specifications team will reply to assist you. Just a note, that while we do not try to explain corrupt documents, we can explain how Word treats Office Open XML elements. We will focus on the rsidRoot question you have asked here. 

    Best regards,
    Tom Jebo 
    Sr Escalation Engineer
    Microsoft Open Specifications Support

    Tuesday, September 18, 2018 3:47 PM
    Moderator
  • Thanks for reply. This time, I migrate my simple application tool CLR4 and OpenXML sdk 2.5 environment. Still not stable.

    Blank dotx with bookmark to create docx from. And insert a picture with openxml.

    In the following screenshot, the left represent the document that work. the right one cannot be opened with ms word.

    This time, I suspect the total time difference. The one that work is the same as revision in core.xml. but the "corrupt" document has total time 2 and revision 1.  Is this blocking Word from opening the doc? How can this happen?



    • Edited by GuYuming Wednesday, September 19, 2018 9:53 AM
    Wednesday, September 19, 2018 9:45 AM
  • update: I just open the docx file with 7.zip, modify the totaltime with notepad. 

    I don't know whether this can be a valid way to test. However, the document still cannot be opened after totaltime changed from 2 to 1.

    Wednesday, September 19, 2018 10:03 AM
  • Hi GuYuming, 

    The rsidRoot should always be the same value when looking at the same document (but possibly different versions). Therefore, there's something wrong with the way this is being stored. 

    I doubt that the TotalTime value has anything to do with Word not opening the document.

    Since you are using the Open XML SDK to operate on the Word document, I suggest that you use the latest bits from: 

    https://github.com/OfficeDev/Open-XML-SDK

    There have been changes to the packaging and other functionality which could affect this. 

    Also, I'm going to recommend that you log an issue on the Open XML SDK repo issue list: 

    https://github.com/OfficeDev/Open-XML-SDK/issues

    If possible, when you log the issue, provide the code used to make the changes to the Word document and we can try to help you work through this over there.

    Tom


    Wednesday, September 19, 2018 10:25 PM
    Moderator
  • I guess it can be related to rsid, since I am saving to SharePoint library and the Office Upload Center is working. If custom program is updating the document with OpenXml, and if Office keep local copy , merge may be involved(although I had not found proof for it).

    when I insert the Run into office doc with openxml, I did not specify a rsid. If I new Run{ RsidRunAddition="00684360"} . I can see in the resulting /word/document.xml the rsid, but will not see the rsid in /word/settings.xml. Is that normal? how to correctly deal with rsid when insert picture with openxml?

    Thursday, September 20, 2018 10:36 AM
  • GuYuming, 

    I don't think that should be an issue but you should test with a local file only just to make sure. 

    Again, since this is being done programmatically with Open XML SDK code, please open an issue on the github repo (mentioned earlier) and we can help you there. 

    Tom

    Thursday, September 20, 2018 7:53 PM
    Moderator
  • I do picture insertion with Word2016 and change picture, and then compare the resulting files with sdk productivity tools.

    To my astonishment, the rsidroot value in settings.xml is always the "FIRST" one. But insert picture and change picture operation do add new rsid in settings.xml. 

    For picture insert, in /word/document.xml, the corresponding rsid change take place in the paragraph outside the draw. 

    For picture change, no corresponding rsid change in /word/document.xml, (I did not find corresponding rsid in anywhere in the package) ,  but there is change to the EditId.

     

    BTW, I create thread in open xml format sdk forum first, I just found that it is the recommend queue by the GitHub portal. I already create new issue in GitHub. Since GitHub does not have Window Live ID integrated sign-in , I constantly have trouble with authentication, so I usually create thread in this community.
    • Edited by GuYuming Friday, September 21, 2018 1:59 AM
    Friday, September 21, 2018 1:39 AM
  • GuYuming, 

    Thanks for opening the issue on the SDK's github repo. This problem can go either way depending on what the root is but since you are using the SDK, it's better to start there. We may end up looking at the definitions of Office Open XML standard elements and their behaviors. But I suspect it's more about the code. 

    I'll respond on the github issue and the community is also free to assist as well. 

    Tom

    Friday, September 21, 2018 5:35 PM
    Moderator
  • GuYuming, 

    Can you please post sample code to the github issue to demonstrate how you reproduce this issue?

    https://github.com/OfficeDev/Open-XML-SDK/issues/523

    Tom

    Wednesday, September 26, 2018 6:08 PM
    Moderator