Hi there,
You can search for some file in all sub directories too:
Dim filePaths As String() = Directory.GetFiles(YOUR_HEADER_FOLDER_PATH, YOUR_FILTER, SearchOption.AllDirectories)
The importing thing is the use System.IO.Directory class and add the third parameter SearchOption.AllDirectories
YOUR_HEADER_FOLDER_PATH should be your header folders path. Lets say I want to get every file on public desktop. Then its = "C:\Users\Public\Desktop"
And I want to get all the files contain "TEST" on their name. Then Filter will be "*TEST*".
so at the end this is the final:
Dim filePaths As String() = Directory.GetFiles("C:\Users\Public\Desktop", "*TEST*", SearchOption.AllDirectories)
For example if you want to get all Part Document files in C disk, you can use:
Dim filePaths As String() = Directory.GetFiles("C:\", "*.ipt", SearchOption.AllDirectories)
You can use Wildcards on filter. Further information about the wildcards:
https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/wildcard-charact...
I hope it helps.
If my answer is solved your problem, please mark it as Solution
Freundliche Grüße / Kind Regards