LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default FileSearch fails to locate *.jpg and *.tif files

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
filesearch not finding files Kevin Excel Programming 1 January 18th 05 01:49 PM
Filesearch : .zip files not found ??? Benoît HUBERT Excel Programming 1 September 1st 04 06:28 PM
FileSearch dislikes Zip-files Hub van de Laar Excel Programming 4 September 1st 03 08:50 PM
FileSearch dislikes Zip-files Hub van de Laar Excel Programming 0 September 1st 03 06:53 PM
FileSearch dislikes Zip-files Hub van de Laar Excel Programming 0 September 1st 03 06:52 PM


All times are GMT +1. The time now is 08:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"