By using t2do.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

GetFileName( )

Function GetFileName(sFile As String) As String
'Version: 1.000
'Purpose: Gets the file name dropping any leading directories
Dim i As Long
GetFileName = sFile
For i = Len(sFile) To 1 Step -1
    If Mid(sFile, i, 1) = "\" Then
        GetFileName = Mid(sFile, i + 1)
        Exit Function
    End If
Next

End Function