Private Sub Command1_Click()
Dim listCollection As IWMPPlaylistCollection Dim list As IWMPPlaylist Dim wmpMedia As IWMPMedia Dim name As String Dim songs(2) As String Dim i As Integer name = "test" songs(0) = App.Path & "\1.mp3" songs(1) = App.Path & "\2.mp3" songs(2) = App.Path & "\3.mp3" Set listCollection = WindowsMediaPlayer1.playlistCollection Set list = listCollection.newPlaylist(name) WindowsMediaPlayer1.currentPlaylist = list For i = 0 To UBound(songs) Set wmpMedia = WindowsMediaPlayer1.newMedia(songs(i)) WindowsMediaPlayer1.currentPlaylist.appendItem wmpMedia Next WindowsMediaPlayer1.Controls.play End Sub |
|