One more way...
vb Code:
Dim PDFFilPth As String PDFFilPth = "C:\Temp\" 'When it finds a PDF file, it adds it to a Combox (cmbPDF): ' Find PDF in Multiple Folders and Lists them Dim rootDi As New DirectoryInfo(PDFFilPth) Dim di As DirectoryInfo For Each di In rootDi.GetDirectories Dim PDFdirs() As String = Directory.GetFiles(PDFFilPth & di.Name) For Each PDFfilname In PDFdirs PDFtestname = System.IO.Path.GetFileName(PDFfilname) 'Check for PDF files and add to Combox 'cmbPDF' Dim FilTest As String = PDFtestname.Remove(0, (Len(PDFtestname) - 3)) If UCase(FilTest) = "PDF" Then cmbPDF.Items.Add (PDFtestname) End If Next Next




Reply With Quote