Originally Posted by
Darryl
Hi everyone.
In Xp there was a way to do a printout of my music collection from WMP to
Excell using a third party plugin.
Is there a way to do this in Vista?
I have WVHPremium.
Hello Darryl,
I am no
VB expert, but I found this solution and it works fine for me using a simple
VB script and Excel. I get an error message in MS Office 07, but the output is still correct:
Here’s what you do:
1. Copy the script below (select the text with your cursor and click Ctrl + C).
Set objPlayer = CreateObject("WMPlayer.OCX" )
Set objMediaCollection = objPlayer.MediaCollection
Set colSongList = objMediaCollection.getByAttribute("MediaType", "Audio")
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Cells(1,1) = "Song"
objWorksheet.Cells(1,2) = "Artist"
objWorksheet.Cells(1,3) = "Album"
objWorksheet.Cells(1,4) = "Length"
objWorksheet.Cells(1,5) = "Times Played"
j = 2
For i = 0 to colSongList.Count - 1
Set objSong = colSongList.Item(i)
objWorksheet.Cells(j,1) = objSong.Name
objWorksheet.Cells(j,2) = objSong.getItemInfo("WM/AlbumArtist")
objWorksheet.Cells(j,3) = objSong.getItemInfo("Album")
objWorksheet.Cells(j,4) = objSong.durationString
objWorksheet.Cells(j,5) = objSong.getItemInfo("UserPlayCount")
j = j + 1
Next
Set objRange = objWorksheet.UsedRange
objRange.Columns.AutoFit()
2. Open Notepad and paste the code into the empty Notepad document.
3. Click ‘Save as…’ and change ‘Save as type’ from ‘Text documents’ to ‘All files’.
4. Click in the File name box and name your script with a .vbs extension. Something like music_cataloger.vbs, for example. Click Save.
5. Find the file you’ve just saved and double-click it.
And that’s it! Almost immediately, a Microsoft Office Excel spreadsheet such as the one shown above will open (click to see it bigger), with a list of your tracks which you can sort by song, artist, album, length and even the number of times played.
Neat, huh?