How do I create a variable to find different numbered invoice pdfs

I need help opening up invoice pdfs that have different numbers each time in the file name.

The file name is always “######_00_20200723.pdf” - the # always change every week

How can I create a variable that can help me open up the invoice files that the numbers of the file name change?

Hi @olsonse,

You can use the following code to get the list of file paths in the directory, which can be used to open the file.

strFiles = Directory.GetFiles("C:\Users\Documents\","??????_00_20200723.pdf")

The list variable strFiles store a list of file paths which can be opened one by one using for each loop.

Hope it will help, Mark it as a solution if you find it useful.

Warm Regards,
Ranjith Udayakumar