application.filesearch pdf files

M

mt

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?
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.)

my code is:


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top