Private Declare Function SearchPath Lib "kernel32" Alias "SearchPathA" (ByVal _ lpPath As String, ByVal lpFileName As String, ByVal lpExtension As String, _ ByVal nBufferLength As Long, ByVal lpBuffer As String, _ ByVal lpFilePart As String) As Long' Search a file on the system' returns the complete file path+name, or "" if file not found'' If SearchDirs is omitted, then the file is searched' in the following directories, in this order' 1. the directory from where the app loaded' 2. the current directory' 3. the WindowsSystem32 directory (if under WinNT)' 4. the WindowsSystem directory' 5. the Windows directory' 6. the directories listed in the PATH environment variableFunction SearchFileOnPath(ByVal FileName As String, _ Optional SearchDirs As String) As String Dim buffer As String * 260 Dim length As Long Dim sDirs As String ' if 2nd argument is omitted, leave sDirs = vbNullString If Len(SearchDirs) Then sDirs = SearchDirs length = SearchPath(sDirs, FileName, vbNullString, Len(buffer), buffer, _ vbNullString) SearchFileOnPath = Left$(buffer, length)End Function


Top Software Development Companies
Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in