Unhandled Exception: System.Runtime.InteropServices.COMException: The file appears to be corrupted. RRS feed

  • Question

  • Hello support team,

    we are using Microsoft.Office.Interop.Word dll to convert to pdf which is working fine when executing "exe" created from visual studio. when we were on windows server 2012 with microsoft office 2013 we created a folder "Desktop" inside C:\Windows\System32\config\systemprofile and syswow64.

    But on other server 2016 , we are facing below error.

    We are able to open the file, which is mentioned in the the error. In error saying as it is corrupted.

    Unhandled Exception: System.Runtime.InteropServices.COMException: The file appears to be corrupted.

    2019-11-26 11:09:20,065 INFO  [stdout] (default task-37)    at Microsoft.Office.Interop.Word.Documents.Open(Object& FileName, Object& ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles, Object& PasswordDocument, Object& PasswordTemplate, Object& Revert, Object& WritePasswordDocument, Object& WritePasswordTemplate, Object& Format, Object& Encoding, Object& Visible, Object& OpenAndRepair, Object& DocumentDirection, Object& NoEncodingDialog, Object& XMLTransform)

    Is it related to access issue on "Desktop" folder or application related issue from where we are trying to run this "exe"

    Please help us to resolve this issue

    Tuesday, November 26, 2019 7:38 AM

All replies

  • Hi,

    This forum focuses more on general questions related to Word desktop applications, considering the issue is mainly related to Office development in Visual Studio, I would move this question to the following forum: Word for Developers. You may get more replies there. 

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Best Regards,


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Office 2019.

    Wednesday, November 27, 2019 2:47 AM