?
Solved

VBA macro to create mp3 list

Posted on 2005-03-23
13
Medium Priority
?
568 Views
Last Modified: 2008-03-17
Can the VBA macro for Word handle the following task: create lists of mp3 files, i.e. scan specified drives or folder for mp3 files(mp3, ogg), to decode the information(from ID3 tags) that is stored on each .mp3 file (artist, album, year, size), extract this data and create playlists based on this data? The lists will be stored as .M3Us (standard playlist format for MP3s).
0
Comment
Question by:Sirocco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 2
13 Comments
 
LVL 32

Expert Comment

by:Erick37
ID: 13613497
Here is sample code to read the ID3 tags from the files:

Extract the ID3 Tag from an mp3 File
http://www.freevbcode.com/ShowCode.Asp?ID=1118
0
 

Author Comment

by:Sirocco
ID: 13614062
well, and how implement this to handle full task- i.e. scan specified drives or folders and create numbered lists of mp3 files?
0
 
LVL 32

Expert Comment

by:Erick37
ID: 13614065
Something like this can be used to get the info into a ListBox:

'add a reference to "Microsoft Scripting Runtime"
Dim fso As Scripting.FileSystemObject
Dim fld As Folder
Dim file As file
Dim id3 As ID3Tag

Set fso = New FileSystemObject
'Set this to be the folder to scan
Set fld = fso.GetFolder("C:\Documents and Settings\Me\My Documents\My Music\")

ListBox1.Clear
ListBox1.ColumnCount = 3

'loop through each file in the folder
For Each file In fld.Files
    'it it's an MP3, add it to the list
    If file.Type Like "MP3 audio file*" Then
        'grab the ID3 info
        Call GetID3Tag(fld.Path & "\" & file.Name, id3)
        ListBox1.AddItem file.Name
        ListBox1.List(ListBox1.ListCount - 1, 1) = id3.Artist
        ListBox1.List(ListBox1.ListCount - 1, 2) = id3.Year
    End If
Next
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Sirocco
ID: 13614777
I find some solution that list files in specified folder:

http://support.microsoft.com/?kbid=306248

How to make a small adjusting of this code:

1. list only file name - without full path, i.e.  'Rainbow.mp3'
(Currently macro list full path - C:\Documents and Settings\User\My Documents\mp3utilities\Rainbow.mp3 )

2. show file size in Megabytes, not bytes

3. to number the list of files (01, 02..)

4. to adjust distance between columns

5. to set preffered font name and size
0
 

Author Comment

by:Sirocco
ID: 13841297
Please refund my points. I find macro http://support.microsoft.com/?kbid=306248
which just should be adjusted to meet my needs.
0
 

Author Comment

by:Sirocco
ID: 13962366
Please close my question.
0
 

Author Comment

by:Sirocco
ID: 13976202
Please close my question.
0
 

Author Comment

by:Sirocco
ID: 13978306
Please close my question and refund points.
0
 

Author Comment

by:Sirocco
ID: 14078798
Please close my question and refund points.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 14395780
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question