比如:
book1.xls 中的xls
文档1.doc 中的doc

解决方案 »

  1.   

    Option Explicit'引用Microsoft Scripting Runtime
    Private Sub Command1_Click()
        Dim fso As FileSystemObject
        Dim sFile As String
        
        CommonDialog1.ShowOpen
        sFile = CommonDialog1.FileName
        
        Set fso = New FileSystemObject
        MsgBox fso.GetExtensionName(sFile)
        Set fso = Nothing
    End Sub
      

  2.   

    有没有不用引用Microsoft Scripting Runtime
    的方法???
      

  3.   

    CommonDialog1.FileName中就显示了后缀名
      

  4.   

    有没有不使用Microsoft Scripting Runtime的方法?
      

  5.   

    用FileListBox好像不受影响
    用Dir函数也可以得到扩展名~