ExtractFileName
It extracts a filename from a filepath.
Inputs
A string comtaining a valide path & filename
Assumes
Put this function in a module or the declaration section of a form in which this function is needed.
Returns
Returns only the filename
Side Effects
It only works with VB6, this of the function 'StrReverse' which is not in previous versions of VB
Rate ExtractFileName
(41(41 Vote))
Public Function ExtractFileName(ByVal strPath As String) As String
' StrReverse is only working in VB6
strPath = StrReverse(strPath)
strPath = Left(strPath, InStr(strPath, "\") - 1)
ExtractFileName = StrReverse(strPath)
End Function
ExtractFileName Comments
No comments yet — be the first to post one!
Post a Comment