DougHomeOffice
Programmer
How do I get the extension of a file when I have the full name and path as a string
-Thanks
-Thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function GetFileExtension(strFileName As Variant) As String
Dim strTemp As String
Dim strTemp2 As String
Dim intPos As Integer
If IsNull(strFileName) Then
strTemp = " "
Else
strTemp2 = strFileName
intPos = InStrRev(strTemp2, ".")
If intPos = 0 Then
strTemp = " "
Else
If intPos = Len(strTemp2) Then
strTemp = " "
Else
strTemp = Mid(strTemp2, intPos + 1)
End If
End If
End If
GetFileExtension = strTemp
End Function