I am working in access 2003. I am looking to implement code to search a directory for all files containing a text string. File types are doc xls or pdf. I am using application.filesearch to do this and it works for .doc and .xls. Used appication.filetypes.add to add doc word and excel filetypes. How do I add pdf file types?
my code is
if I exclude the .filename = "*.pdf" then I get word and excel files. With *.pdf I get every file in the directry including gifs jpgs and search is very slow( a lot of images in the directory- dont want to search those.)


With Application.FileSearch
.NewSearch
.LookIn = "N:\projects\40005.4 Microsphere Development\Database - Lab Reports"
.SearchSubFolders = True
.TextOrProperty = Me.Text28.Text
.FileTypes.Add (msoFileTypeWordDocuments)
.FileTypes.Add (msoFileTypeExcelWorkbooks)
.SearchSubFolders = True
.filename = "*.pdf"
.MatchAllWordForms = True
If .Execute() > 0 Then


thanks
Matt