Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using Office 2003 on Windows XP.
I am using FileSearch to locate files containing certain text. The keyword text I am searching for is stored in the file properties. This seems to work okay for MS-Word and MS-Excel (have not tested MS-Access). But, for *.jpg and *.tif files, the CODE fails to return anything (again the search text is stored in the file properties). However, if I conduct a MANUAL search from Windows Explorer, it returns the *.jpg files but not *.tif files. PLEASE note that a copy of my code follows. 1) Can anyone explain this anomaly and/or fix my code so that this behaviour will be corrected? 2) Why does the manual search not capture ALL files? 3) I have noticed that some *.jpg and *.tif files do not have accessible file properties, does anyone know why and how/if I can add file properties to such files? Thanks much in advance for your assistance. My function: Public Function FileSearchText(argSearchText As String, argSearchFolder As String, argSearchSubFolders As Boolean) As Variant 'RETURNS AN ARRAY OF FULL NAMES OF FILES CONTAINING TEXT SEARCHED FOR; Dim ofsSearch As FileSearch Dim ofsFound As FoundFiles Dim lX As Long Dim vaFound() As String Set ofsSearch = Application.FileSearch With ofsSearch .NewSearch .TextOrProperty = argSearchText .MatchTextExactly = False .MatchAllWordForms = True .LookIn = argSearchFolder .SearchSubFolders = argSearchSubFolders .FileType = msoFileTypeAllFiles .Execute End With Set ofsFound = ofsSearch.FoundFiles If ofsFound.Count < 1 Then MsgBox "None found.": End For lX = 1 To ofsFound.Count ReDim Preserve vaFound(lX) vaFound(lX) = ofsFound(lX) Next lX FileSearchText = vaFound End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
filesearch not finding files | Excel Programming | |||
Filesearch : .zip files not found ??? | Excel Programming | |||
FileSearch dislikes Zip-files | Excel Programming | |||
FileSearch dislikes Zip-files | Excel Programming | |||
FileSearch dislikes Zip-files | Excel Programming |