chosing specific files in a directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jacobevans
    New Member
    • Aug 2007
    • 26

    chosing specific files in a directory

    What im trying to do is have all .mp3, .wma, and .wav files in the chosen directory go on a list. I've been at this for several days and came up with nothing. Any suggestions?

    Code:
    On Error Resume Next
    Dim i As Integer, splitfilename() As String
    flstSongs.Path = dirMusic.Path
    If flstSongs.ListCount <> 0 Then
        For i = 1 To flstSongs.ListCount - 1
            splitfilename = Split(flstSongs.List(i), ".", 2)
            splitfilename(1) = LCase(splitfilename(1))
            Select Case splitfilename(1)
                Case "mp3"
                    MsgBox "MP3"
                    frmAmperage.lstFilePath.AddItem dirMusic.Path & "\splitfilename(0)"
                    frmAmperage.lstFilename.AddItem splitfilename(0)
                    i = i + 1
                Case "wma"
                    MsgBox "WMA"
                    frmAmperage.lstFilePath.AddItem dirMusic.Path & flstSongs.FileName
                    frmAmperage.lstFilename.AddItem flstSongs.FileName
                    i = i + 1
                Case "wav"
                    MsgBox "WAV"
                    frmAmperage.lstFilePath.AddItem dirMusic.Path & flstSongs.FileName
                    frmAmperage.lstFilename.AddItem flstSongs.FileName
                    i = i + 1
                Case Else
                    i = i + 1
            End Select
  • jacobevans
    New Member
    • Aug 2007
    • 26

    #2
    Does anybody have any ideas?

    Comment

    • wireshark
      New Member
      • Mar 2008
      • 29

      #3
      Originally posted by jacobevans
      Does anybody have any ideas?
      why you dont try to use filelistbox,dir and drive list box ocx?
      it would be easier for your. set the filter at the filelistbox ocx.

      Comment

      • jacobevans
        New Member
        • Aug 2007
        • 26

        #4
        Good idea, I'll try it out. Thanks

        Comment

        Working...