This code gets the file name from a given path.
This code gets the file name from a given path.
API Declarations
No declarations required for this code.
Rate This code gets the file name from a given path.
(1(1 Vote))
'This function gets the filename from a path
'PathString must include the filename in the whole path.
'Usage: StringName = NameFromPath(PathString)
Dim X As Integer, Ps As Integer, Tmp As String
Tmp = FilePath
For X = 1 To Len(Tmp)
Ps = InStr(1, Tmp, "\", vbTextCompare)
If Ps <> 0 Then
Tmp = Mid(Tmp, Ps + 1)
Else
End If
Next X
NameFromPath = Tmp
End Function
This code gets the file name from a given path. Comments
No comments yet — be the first to post one!
Post a Comment