Function SearchForFile(objFolder, strFile) Dim fils, fil, fols, fol, strFilePath 'Check all the files in the current folder On Error Resume Next Set fils = objFolder.Files If Err.Number = 0 Then For Each fil In fils If fil.Name = strFile Then SearchForFile = fil.Path Exit Function End If Next End If 'Check for any sub folders and recursively search them Set fols = objFolder.SubFolders For each fol in fols strFilePath = "" strFilePath = SearchForFile(fol, strFile) If strFilePath <> "" Then SearchForFile = strFilePath Exit Function End If Next SearchForFile = strFilePath End Function