Get a file extension
Get a file extension
Rate Get a file extension
(2(2 Vote))
' FUNCTION: Extension
'
' Extracts the extension portion of a file/path name
'
' IN: [strFilename] - file/path to get the extension of
'
' Returns: The extension if one exists, else vbnullstring
'
Function Extension(ByVal strFilename As String) As String
Dim intPos As Integer
Extension = vbNullString
intPos = Len(strFilename)
Do While intPos > 0
Select Case Mid$(strFilename, intPos, 1)
Case "."
Extension = Mid$(strFilename, intPos + 1)
Exit Do
Case Else
End Select
intPos = intPos - 1
Loop
Get a file extension Comments
No comments yet — be the first to post one!
Post a Comment