Exporting Media Player 11 playlists in Access 2003

G

Guest

Is it possible to export my playlists into Access XP without resorting to 3rd
party software, and if it is, is there a format file showing how Media Player
lists the data within the playlist?
 
D

Douglas J. Steele

While aimed at VBScript, not VBA, take a look at
http://www.microsoft.com/technet/scriptcenter/funzone/player.mspx for
details of how to read the data that's stored in WMP (although there are
some errors in that article).

For example, the following will list all playlists:

Sub ListAllPlaylists()

Dim objPlayer As Object
Dim objPlaylists As Object
Dim colPlaylists As Object
Dim objPlaylist As Object
Dim intLoop As Integer

Set objPlayer = CreateObject("WMPlayer.OCX" )
Set objPlaylists = objPlayer.PlaylistCollection

Set colPlaylists = objPlaylists.getAll()

For intLoop = 0 to colPlaylists.Count - 1
Set objPlaylist = colPlaylists.Item(intLoop)
Debug.Print objPlaylist.Name
Next intLoop

End Sub

and the following will list all songs in a given playlists:

Sub ListPlaylistSongs(NameOfPlaylist As String)

Dim objPlayer As Object
Dim objPlaylists As Object
Dim objAll As Object
Dim objList As Object
Dim objSong As Object
Dim intLoop As Integer

Set objPlayer = CreateObject("WMPlayer.OCX" )

Set objPlaylists = objPlayer.PlaylistCollection
Set objAll = objPlaylists.getByName(NameOfPlaylist)
Set objList = objAll.Item(0)

For intLoop = 0 to objList.Count - 1
Set objSong = objList.Item(intLoop)
Debug.Print objSong.Name
Next intLoop

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top