Word-The File Appears To Be Corrupted

Hello, i am getting this error idk why. i searched previous posts that has same issues but i coulndt find a solution for me that works.

RemoteException wrapping System.Runtime.InteropServices.COMException: The file appears to be corrupted.
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)
at UiPath.Word.WordDocument…ctor(String documentPath, Boolean createNew, Boolean readOnly, Boolean attachOnlyIfFileOpen, Boolean attachToAnyFile)
at UiPath.Word.Activities.WordApplicationScope.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

uploading my flow.
i need to fix this could u guys help me. (using studiox2020.10.2 and cant open studio)

Hi @aayc

In the For Each file in Folder activity give the fi,ter by option in double quotes like below way

"*.docx"

This will read only .docx files and will solve the error.

Hope it helps!!

but i already have it done

@aayc

Please use a log message and log the filepath once…may be there are some temporary files and it is also getting considered…

Please show the logged pth here to verify

Cheers

Hi

Would recommend to check for these details

  1. Check the file extension. Make sure that the file you are trying to open is a Word document (.docx or .doc).
  2. Check the file permissions. Make sure that you have permission to open the file.
  3. Try opening the file manually so that I can confirm whether it’s the issue with file itself or not

Let us know if these didn’t work still
@aayc