Dim oFile As Object, oFolder As Object
Set oFolder = CreateObject("scripting.filesystemobject").GetFolder("C:\")
For Each oFile In oFolder.Files
If InStr(1, oFile.Name, ".pdf", vbTextCompare) Then MsgBox oFile.Path Else: Next oFile
...
Next oFile
End Sub
Naturally the above will throw up...