Looping sequence through an entire folder of PDFs



I am trying to get my sequence to loop through an entire folder of PDFs. The sequence is pulling key fields from a PDF file and putting the data into an Excel file. The sequence works for the first PDF, but I am unable to get the loop to do the same for the rest of the PDF files in the folder.

Has anyone tried this?

Thank you!



I think you will need to get all the files you want to process stored in some list. If it’s all files of certain pattern in a folder, then you can get that list using System.IO.Directory.GetFiles() --there are examples throughout the forums and online since it’s vb.net language

With that list you can perform all the actions you want for 1 pdf file inside a ForEach.

Assign filelist = System.IO.Directory.GetFiles(folderpath)
ForEach file In filelist //typeargument property as String
   Read PDF using file as filepath
   <Perform actions>

Something like that.

Hope that helps.



Hi @Brian,

Use the below code to get list of pdf file in array value

Directory.GetFiles(folderlocation, "*.pdf")

Regards, Arivu :slight_smile: