ramitaherwahdan
New member
- Local time
- Today, 07:35
- Joined
- Feb 21, 2011
- Messages
- 9
Dear All,
Thanks for helping... I have a function that I found while googling that catches that file file name and extension from a path. I would like to modify this to catch only the file name without the extension.
here is the code:
Function GetFilenameFromPath(ByVal strPath As String) As String
' Returns the rightmost characters of a string upto but not including the rightmost '\'
' e.g. 'c:\winnt\win.ini' returns 'win.ini'
If Right$(strPath, 1) <> "\" And Len(strPath) > 0 Then
GetFilenameFromPath = GetFilenameFromPath(Left$(strPath, Len(strPath) - 1)) + Right$(strPath, 1)
End If
End Function
Thanks
Thanks for helping... I have a function that I found while googling that catches that file file name and extension from a path. I would like to modify this to catch only the file name without the extension.
here is the code:
Function GetFilenameFromPath(ByVal strPath As String) As String
' Returns the rightmost characters of a string upto but not including the rightmost '\'
' e.g. 'c:\winnt\win.ini' returns 'win.ini'
If Right$(strPath, 1) <> "\" And Len(strPath) > 0 Then
GetFilenameFromPath = GetFilenameFromPath(Left$(strPath, Len(strPath) - 1)) + Right$(strPath, 1)
End If
End Function
Thanks