看看我的方法
filename="mm.txt.exe.abc"
aa=split(filename)
bb=ubound(aa)
fileend=aa(bb)
fileend就是文件的后缀
----------------------------
修改:
filename="mm.txt.exe.abc"
if instr(filename)<>0 then
aa=split(filename)
bb=ubound(aa)
fileend=aa(bb)
else
fileend=""
end if
请注意,InstrRev函数的语法和Instr函数的语法不相同。
'------------------------------------------------------
'例子
Dim i As Integer
i = InStrRev("Hello_120.exe.scr", ".")
MsgBox Right("Hello_120.exe.scr", Len("Hello_120.exe.scr") - i)