- Home
·
- Miscellaneous
·
- Function to Get the File name only where File name with Folder name is passed
Function to Get the File name only where File name with Folder name is passed
Function to Get the File name only where File name with Folder name is passed
Rate Function to Get the File name only where File name with Folder name is passed
(1(1 Vote))
' To get file name from file object
On Error GoTo LOCALERRORHANDLER
Dim intInc As Integer 'For incremental value
Dim intPos As Integer 'For storing position
For intInc = 1 To Len(strFileName)
If MID(strFileName, intInc, 1) = "\" Then
intPos = intInc
End If
Next
fnGetFileName = MID(strFileName, intPos + 1)
Exit Function
LOCALERRORHANDLER:
fnGetFileName = ""
End Function
Function to Get the File name only where File name with Folder name is passed Comments
No comments yet — be the first to post one!
Post a Comment