I got this nice little function via a google search. But it is doing the exact opposite of what I need. It is taking a filename (Ex: test.jpg) and returning the extension and preceding period (Ex: .jpg). I need to rework this to only return the filename, everything before the period and extension (Ex: test). Can anyone help me do this?
Code:
function StripFileExt(strFileName)
if strFileName = "" Then Exit function
if InStr(1, strFileName, ".") = 0 Then Exit function
StripFileExt = Right(strFileName, Len(strFileName) - InStrRev(strFileName, ".") + 1)
End function