Results 1 to 4 of 4

Thread: search for file

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    6
    i want to search for file. i know the directory and file name. All i know to search this file inside the directory before do anything.

    Amal

  2. #2
    Member
    Join Date
    Sep 2000
    Posts
    34
    Public Function FileExists(strPath As String) As Integer

    FileExists = Not (Dir(strPath) = "")

    End Function

  3. #3
    Guest
    Or use filesystem object(add the Microsoft Scripting Runtime reference to the project)


    dim objfso as FileSystemObject
    Set objfso = CreateObject("Scripting.FileSystemObject")

    if objfso.FileExists(objfso.BuildPath(strDirectory,strFileName)) then
    msgbox "File exists"
    else
    msgbox "File does not exist"
    end if


  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Unless you have multiple uses for FileSystemObject it shouldn't be an option as when you package your application you will have to add the extra baggage of the dll for the FSO. (scrrun.dll)

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

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



Click Here to Expand Forum to Full Width