|
Sub Ext(fname)
Select Case Mid(fname, InStrRev(fname, ".") + 1, Len(fname)) 'detects if extension is text file Case "txt" MsgBox "Text File" 'detects if extension is an executable file Case "exe" MsgBox "Executable" End Select End Sub Private Sub Form_Load() 'this passes the filename to the Ext Sub Ext ("blah.exe") End Sub |