I get Error in Word to pdf convert

Hello Uipath family, I get an error when am trying to convert the world file to pdf I share the screen shoot bellow you please check.
The thing is pdf file is converted when am getting an error is when there is no file to convert pdf to word on that time I get an error I hope you people get my point at the end of the time its showing error why I don’t know please help me @Vajrang but pdf file is saved but the robot is not run successfully.
:point_down:
20.4.3

Source: Word Application Scope

Message: The file appears to be corrupted.

Exception Type: System.Runtime.InteropServices.COMException

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)
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)





Thanks, Chethan P

It seems to be problem with word document.
Please open word manually and check if it is working.
Check the file paths properly or try to hard code the file names and verify

1 Like

I check it, its work properly and I create one dummy project in that time it is working properly there, I don’t know why it’s not working properly hear and the thing is the world is converted to pdf properly at the end of the time again it enters the for each loop so its get error I don’t know y it enters the for each loop

@Vajrang

ConvertWordsToPdfFiles.zip (46.1 KB)

Hi,
I have done the sample workflow as you showed in your screenshots.
Please refer the attached workflow file and compare with your code.

I hope it works for you.
Please mark as solution if it works

1 Like