Function File Names Class

FindFileInDirectoryList

Return the name of the first directory in the string list that contains a specific file. For example, find "DAO2016.DLL" within the directory list "C: \WINDOWS C:\WINDOWS\SYSTEM C:\WINDOWS\OLESVR".

Signature (Visual Basic / VBA)

Public Function FindFileInDirectoryList( _
      ByVal vFile As Variant _
    , ByVal vDirList As Variant _
    , Optional ByVal vSeparator As Variant _
    , Optional ByVal vAttributes As Variant _
    ) As Variant

Code Example

    ? est.FindFileInDirectoryList("DAO2016.DLL", "C:\WINDOWS C:\WINDOWS\SYSTEM")
    C:\WINDOWS\DAO2016.DLL

Parameters

Parameter Description
vFile Name of the file that is to be located within the specified directories. Function returns Null if vFile is null or cannot be fixed-up to a string.
vDirList ("Directory List ") String containing the names of the directories that will be searched for a file named vFile. Function returns Null if vDirList is null or cannot be fixed-up to a string.
vSeparator String that separates the directory names within string vDirList. vSeparator defaults to the space character if it is missing or Null or cannot be fixed-up to a string.
vAttributes One or more of the vb constants vbNormal, vbHidden, vbSystem, vbVolume, and vbDirectory describing the types of files to be included in the search. vAttributes defaults to vbNormal if it is missing or Null or cannot be fixed-up to a number.