Probs w/ A97 example code using Application.FileSearch

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MLH

    #1

    Probs w/ A97 example code using Application.FileSearch

    With Application.Fil eSearch
    .NewSearch
    .LookIn = "C:\My Documents"
    .SearchSubFolde rs = True
    .FileName = "Run"
    .MatchTextExact ly = True
    .FileType = msoFileTypeAllF iles
    End With

    My code pukes complaining that msoFileTypeAllF iles
    is an undefined var type. Isn't it s'posed to be some
    kind of intrinsic constant or something? How can I
    make this little snippet work for me?


  • MLH

    #2
    Re: Probs w/ A97 example code using Application.Fil eSearch

    Oops... forgot to mention that I tried this...

    Private Sub Command0_Click( )
    Dim i As Integer
    With Application.Fil eSearch
    .NewSearch
    .LookIn = "C:\Docs\TitleW ork\Customers"
    .SearchSubFolde rs = True
    .FileName = "*262*.*"
    .MatchTextExact ly = True
    ' .FileType = msoFileTypeAllF iles
    End With
    With Application.Fil eSearch
    For i = 1 To .FoundFiles.Cou nt
    MsgBox .FoundFiles(i)
    Next i
    End With
    End Sub

    This did nothing at all for me. Rem'ing out the
    ..FileType assignment was perhaps a mistake???
    The code runs but I get no MsgBoxes displaying
    FoundFiles.

    Help.

    Comment

    • Salad

      #3
      Re: Probs w/ A97 example code using Application.Fil eSearch

      MLH wrote:
      Oops... forgot to mention that I tried this...
      >
      Private Sub Command0_Click( )
      Dim i As Integer
      With Application.Fil eSearch
      .NewSearch
      .LookIn = "C:\Docs\TitleW ork\Customers"
      .SearchSubFolde rs = True
      .FileName = "*262*.*"
      .MatchTextExact ly = True
      ' .FileType = msoFileTypeAllF iles
      End With
      With Application.Fil eSearch
      For i = 1 To .FoundFiles.Cou nt
      MsgBox .FoundFiles(i)
      Next i
      End With
      End Sub
      >
      This did nothing at all for me. Rem'ing out the
      .FileType assignment was perhaps a mistake???
      The code runs but I get no MsgBoxes displaying
      FoundFiles.
      >
      Help.
      You could use the code at http://www.mvps.org/access/api/api0006.htm.
      One thing it specified..."Be fore using the code, make sure "Microsoft
      Office 8.0 Object Library" (typically referenced to MSO97.DLL under
      Office folder) is selected under Tools/References". This is not the
      Access library but the Office Object library.

      Teardrop

      Comment

      • MLH

        #4
        Re: Probs w/ A97 example code using Application.Fil eSearch

        Thanks, Salad. I think that'll work for me.


        Comment

        Working...