Google Answers Logo
View Question
 
Q: Windows XP Detail - programatically accessing ( No Answer,   2 Comments )
Question  
Subject: Windows XP Detail - programatically accessing
Category: Computers > Programming
Asked by: action-ga
List Price: $10.00
Posted: 20 Feb 2005 13:43 PST
Expires: 22 Mar 2005 13:43 PST
Question ID: 477643
Windows XP automatically populates details (Detail View in Explorer)
for all my media files. For example, it fills in the album and track
number for mp3 files and it tells me when my digital pictures were
taken, and more.

Using VBA or VB scripting, I want to be able to retreive this data
programatically.  I would preferabbly like to do it in Excel, using
VBA, so I can also populate spreadsheets with the data.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Windows XP Detail - programatically accessing
From: jalexandrian-ga on 23 Feb 2005 17:24 PST
 
I have always been curious about this and your question prompted me to
find out how this can be done. I was able to do it by setting a
reference to Windows Media Player (wmp.dll) in my project. After
taking a quick look at the object model, I saw how easy it was to get
the details you are looking for. There are lots of options such as
retrieving just the files by filtering by genre, author, album, ect.
Anyways, below is a sample that will get you started. It creates the
objects and then retrieves the first file it finds (index of zero).
Then it will print every detail you are looking for. For me, it listed
69 different attributes of the file. When you use this in your excel
project, you can call just the attributes you want by name.
Good luck.

Sub Main()
    Dim wmp As New WindowsMediaPlayer
    Dim PL As IWMPPlaylist
    Dim song As IWMPMedia3
    Dim l As Long
    
    Set PL = wmp.mediaCollection.getAll
    
    Set song = PL.Item(0)
    
    For l = 0 To song.attributeCount - 1
        Debug.Print song.getAttributeName(l) & ": " &
song.getItemInfo(song.getAttributeName(l))
    Next l
    
    Set song = Nothing
    Set PL = Nothing
    Set wmp = Nothing

End Sub
Subject: Re: Windows XP Detail - programatically accessing
From: action-ga on 24 Feb 2005 06:24 PST
 
jalexandrian-ga,

Thanks a lot! I'll bet that is what Explorer is using.  I haven't had
time to try it but I wonder how I can get the same info from the exif
data of my photos?  I wonder if there is another .dll that is
providing that info...  more later. Thanks for the great response.

-Jack

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy