'------------------------------------------------ '関数名 :TmGetFileType '概要 :フルパスから拡張子を取得します。 '------------------------------------------------ Public Function TmGetFileType(ByVal strFileName As String) As String
Dim intPost As Integer Dim intCnt As Integer
TmGetFileType = ""
'フルパスの文字数分、最後尾から回します。 For intPost = Len(strFileName) To 1 Step -1 Select Case Mid(strFileName, intPost, 1)
'拡張子識別記号を見つけたら文字を返します。 Case "." TmGetFileType = StrConv(Mid(strFileName, intPost + 1), vbUpperCase) Exit For Case "\", "/" Exit For End Select Next intPost End Function