get duration of a music track using FSO

F

FotoArt

hello everyone
when u open a folder (with mp3 files in it)in details mode u can see the
duration of the track.
Is there a way I can grab this information in a word macro using
FileSystemObject or otherwise?

Any help is appreciated.
thanx
ahmed
 
F

FotoArt

hello steve

I cant seem to get the value
all i get is the property name
how do i get the value of the extended file property.

heres thew code im using

Option Explicit
Sub myTest1()

Dim fso, myFileName, objShell As Object, objFolder As Object, xxx

Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("D:\other\songs")

With Dialogs(wdDialogFileOpen)
myFileName = .Name
.Display

End With

xxx = objFolder.GetDetailsOf(myFileName, 21)

Selection.TypeText xxx

Set fso = Nothing
Set objShell = Nothing
Set objFolder = Nothing

End Sub

thanx
ahmed
 
S

Steve Yandl

Are you running Vista? I'm still on Win XP but I do remember reading
comments in a newsgroup that some of the index numbers might be off kilter.

Take a look at this article on using the MediaPlayer object to do much the
same thing. If the new approach doesn't work, we can experiment with the
index numbers for Shell.Application.

http://www.microsoft.com/technet/scriptcenter/funzone/player.mspx

Steve Yandl
 

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