Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Pennsylvania, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    application.filesearch (Word 2000)

    I'm hoping someone can shed some light on a problem I'm having when using Application.FileSearch to determine whether or not a specific file exists in a specified folder. The general problem is that the Execute method is returning all files that are SIMILAR to the specified file. For example, if I'm looking for RES2222.DOC it is also finding BKP_RES2222.DOC, RES2222_BKP.DOC, and RES2222X.DOC.

    I've tried setting the "match all word forms" property to false, and the "exact match only" property to true, but the result is always the same. (The information about the files it finds is all correct, by the way. It just finds too many of them.)

    Could it be possible that a VBA function doesn't work as advertised? Or am I just missing something obvious.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: application.filesearch (Word 2000)

    Those two properties don't affect file name searches, but why should this broad matching be the default behavior?

    Other options include (1) using Dir and (2) using the FileSystemObject in the scripting library. The first is very lightweight; the second more involved. If you don't really need all of the flexibility and power of Application.FileSearch, Dir is your best bet for now.

  3. #3
    Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Pennsylvania, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: application.filesearch (Word 2000)

    Thank you so much. Dir works great....and tunnel vision is a TERRIBLE thing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •