After merging Documents through DOCX Merge smart service, getting a pop-up window - Word found unreadable content in doc

Hi Team,

Getting below error while trying to open downloaded word document after merging sub documents with smart service DOCX Merge:

Error:
Word found unreadable content in "test 1.docx". Do you want to recover the contents of this document? If you trust the source of this document, click Yes.

Before merge we are able to download and open the single generated word doc without pop up message. After merge of documents with DOCX Merge smart service, we are able to download it but while opening getting the pop up message as shown in screenshot which is attached for reference, when we click on Yes then merged word doc will open up properly. Only thing we need to avoid this pop up message when opening the word doc.


I have posted comment in App Market place as well to check with author of plugin : https://community.appian.com/b/appmarket/posts/dynamic-document-generator

Also we have discussed this issue in community earlier, at that time we followed some steps and achieved to over come this pop up message issue. Currently looking for if any other proper fix or solution is available so that i can apply to avoid this pop up message when opening up word doc.
https://community.appian.com/discussions/f/general/28030/after-merging-documents-through-docx-merge-smart-service-getting-an-error-word-found-unreadable-content-in-test-1-docx


Currently in our DEV environment plugin version is 1.8.5 and our DEV environment is 23.2 version.

Let me know for more details.

Regards,
Sandeep

  Discussion posts and replies are publicly visible

  • Is this happening to merged files regardless of the source Word documents?  Or just a specific one?  How about if you merge two blank ones?

    To diagnose: you need to look into the internal XML file that gets generated in the merged word file and see if any XML formatting issue or unescaped special character has found its way into it.  Open the .xlsx zip file (rename a copy of the downloaded document to end with ".zip" and this will be easy), navigate to the internal folder that contains the xml file, open the xml file in a proper text editor (notepad++ etc), and be prepared to have to parse some gobbletygook.  But the advantage here is you can find exactly what the issue is and try to control for it.

    In my case I always found that error would happen in the "word docx from template" node if any XML-breaking special characters were fed into the smart service, which the smart service allows for but does not sanitize or escape.  That includes "&", "<" and ">" mainly.  The ensuing file becomes completely un-openable (at least in the versions of word I tried, maybe they've made it better since then).  The way I found that was using the approach I detailed above (and looking at the position in the file identified by Word in the error message it gave me when trying to open it).  The solution, at least here, is to replace any such special characters with their XML escaped equivalents, in the original text being inserted during the smart service node call.  For your case, I'm not sure what the solution will be, but guessing it might be something similar.

  • Hi Mike Schmitt,

    Thank you for providing troubleshooting steps.

    1. We have merged two blank docs in DOCX Merge smart service and tested, post that downloaded the merged document and while opening getting same pop-up message. Here, while we are saving blank doc it will ask to select label sensitivity. We are selecting Public and saving doc.

    2. To diagnose, we followed the steps which you have provided and opened the document.xml file which is present inside the word folder. When opened document.xml file it has content related to first sub doc itself. Remaining sub docs content is not present in document.xml.

    Screenshot attached with steps for reference:|
    Debug of merged doc.docx

    Let us know for more details.


    Regards,
    Sandeep