On 5 Dec 2005 11:50:46 -0800, "Bob" <st***********@hotmail.com> wrote:
I got it.
I took the returned path and just used:
Dir(returnedPath)
Jeez... Should have known that one!
Another way to do this (with out the Dir function, which can cause
some interesting results when used in a loop) is to use the
PathFindFileName API call in shlwapi.dll:
Private Declare Function PathFindFileName _
Lib "shlwapi" _
Alias "PathFindFileNameA" _
(ByVal pPath As String) _
As Long
Private Declare Function lstrcpyA _
Lib "kernel32" _
(ByVal RetVal As String, _
ByVal ptr As Long) _
As Long
Private Declare Function lstrlenA _
Lib "kernel32" _
(ByVal ptr As Any) _
As Long
Private Function GetStrFromPtrA(ByVal lpszA As Long) As String
GetStrFromPtrA = String$(lstrlenA(ByVal lpszA), 0)
Call lstrcpyA(ByVal GetStrFromPtrA, ByVal lpszA)
End Function
Public Function GetFilePart(ByVal sPath As String) As String
GetFilePart = GetStrFromPtrA(PathFindFileName(sPath))
End Function
--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing