Results 1 to 2 of 2
  1. #1
    Join Date
    May 2005

    Red face Unanswered: Application.Filesearch won't find my file!!

    Can anyone see what it is I'm doing wrong?! I'm searching for a file to attach to an email, which I KNOW exists in my root (C:\CWA_TOCReport.pdf)

    My call statement is

    If filefound("C:\CWA_TOCReport.pdf") then.....

    here's my function....

    Function FileFound(nFileName) As Boolean
    With Application.FileSearch
    .LookIn = Left(nFileName, 3)
    .FileName = Right(nFileName, Len(nFileName) - Len(.LookIn))
    Debug.Print .LookIn & " " & .FileName
    '.MatchTextExactly = True
    If .Execute() > 0 Then
    Debug.Print .FoundFiles(1)
    'MsgBox "There were " & .FoundFiles.Count & _
    " file(s) found."
    FileFound = True
    Debug.Print nFileName & " file not found."
    FileFound = False
    End If
    End With
    End Function

  2. #2
    Join Date
    May 2005
    Nevermind - I found my answer! Turn off indexing!!

    Method 1: Disable Indexing Service

    1.Click Start, click Run, type Control.exe in the Open box, and then click OK.2.In Control Panel, double-click Administrative Tools, and then double-click Services.3.In the right pane, locate and then click Indexing Service.4.On the Action menu, click Properties.5.On the General tab, click Disabled in the Startup type list, and then click OK to save the changes.6.Close the Services window.
    Last edited by Krista327; 09-16-08 at 15:05.

Posting Permissions

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