README.md

December 5, 2022 ยท View on GitHub

ExtractFileName

Description

It extracts a filename from a filepath.

More Info

A string comtaining a valide path & filename

Put this function in a module or the declaration section of a form in which this function is needed.

Returns only the filename

It only works with VB6, this of the function 'StrReverse' which is not in previous versions of VB

Submitted On
ByD. de Haas
LevelAdvanced
User Rating4.3 (170 globes from 40 users)
CompatibilityVB 6.0
CategoryVB function enhancement
WorldVisual Basic
Archive File

Source Code

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