After merging Documents through DOCX Merge smart service, getting an error Word found unreadable content in "test 1.docx"

Hi Team,

Getting below error while trying to open downloaded document from Appian after merging 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.

Regards,
Sandeep

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Can you share the smart service configurations ?

  • 0
    Certified Lead Developer

    What are the contents of the original DOCX files pre-merger?  Are the original ones openable with no errors?  Is anything getting generated new?

    Usually when I see this error it's because a special character was added to the document and not sanitized first.  These include standard characters like &, < and >.  These must be replaced by their escaped XML equivalents prior to being used (i.e. in the "word doc from template" smart service) or else you'll get an identical error when opening.  The error will also give a position number where the error occurs, which maps to a text position within the source .XML file contained in the .docx Zip file (if you open a .docx using a Zip file manager, you'll see it's just a zip file btw).  If you open that XML file and go to the position indicated you'll likely be able to find the source of the error, which is how I originally learned about this weakness.  Granted if you're just merging 2 already-working DOCX files, i'm not sure this is quite the issue, but the error message you're getting is the same.

  • Hi Abhay,

    Thank you for response. 

    DOCX Merge smart service configuration:

    Source Document: {pv!document1,pv!pv!finaldocument}
    Create New Document: True
    New Document Name: "Test_Doc"
    New Document Desc: "Test_Doc"
    Save In Folder:cons!GENERATED_DOC
    Pause On Error:True
    Separator: NONE

    Actually DOCX Merge smart service is merging the document correctly, the error coming only when we open the downloaded file. From our team one of my team member found the solution and we made the fix, will respond with solution steps for Mike's response.

  • Hi Mike,

    Thank you for the response.

    DOCX Merge smart service is working correctly, before merge we are able to download and open the single generated word doc. After merge of documents we are able to download but while opening getting the error.

    Below is the solution we found:

    This issue was occuring because of sensitivity label present in the source documents of Merge Docx smart service. We were able to open output file in browser but was getting error when opened via native Word application. To resolve this, we had to pass source documents without any sensitivity label associated with them. Our Admin policy had restricted us in creation of documents without sensitivity label.

    We followed below steps to create docx with no labels:-

    1) Find any old docx (oldDoc.docx) file which has no sensitivity labels associated with it.
    2) Open oldDoc.docx file using any archive extractor tool like unzip, secureZip, etc.
    3) Locate and Edit document.xml present in word folder.
    4) Repeat steps 1-3 for your actual source document (newDoc.docx).
    5) Replace all the text present in <w:body> tag of document.xml of oldDoc.docx with the text present in <w:body> tag of document.xml of newDoc.docx.
    6) Save the changes in the oldDoc.docx zip window.
    7) Now you have a document with no labels associated with it. This can be used as source document in Merge Docx smart service.

    Regards,
    Sandeep