InFlight
User
- Local time
- Tomorrow, 09:52
- Joined
- Jun 11, 2015
- Messages
- 130
I am trying to do a test file
It works when i leave some code out but if i add
& " - " & vFolder.GetDetailsOf(vFolderItem, i) & " -") in line 105
i get a this error on line 114
It works when i leave some code out but if i add
& " - " & vFolder.GetDetailsOf(vFolderItem, i) & " -") in line 105
i get a this error on line 114
Code:
Sub vName()
Call fProperties("H:\My Music\Music Finished\Bob Lind", "Bob Lind - 09 - Elusive Butterfly.mp3")
End Sub
Function fProperties(vPath As String, vFile As String)
'vPath is the path of the folder where the MP3 file is located
'vFile is the name of the mp3 file with the extension
Dim vShell As New Shell32.Shell
Dim vFolder As Shell32.Folder
Dim vFolderItem As Shell32.FolderItem
Dim aPropName() As String
Dim s As String
Dim i As Integer
100 Set vShell = CreateObject("Shell.Application")
101 Set vFolder = vShell.Namespace(vPath)
102 Set vFolderItem = vFolder.Items.Item(vFile)
103 For i = 0 To 296
104 ReDim Preserve aPropName(i)
105 aPropName(i) = Format(i, "000 : ") & vFolder.GetDetailsOf(Null, i) & " - " & vFolder.GetDetailsOf(vFolderItem, i) & " -"
106 If Len(vFolder.GetDetailsOf(Null, i)) = 0 Then
107 ReDim Preserve aPropName(i - 1)
' Exit For
108 Else
109 Debug.Print aPropName(i)
110 End If
111 Next
' Create ouput file
Dim Fso, MyFile
112 Set Fso = CreateObject("Scripting.FileSystemObject")
113 Set MyFile = Fso.CreateTextFile(vPath & "\Song List Details - " & vFile & ".txt", True)
114 MyFile.Write Join(aPropName, Chr(13))
115 MyFile.Close
116 Set Fso = Nothing
117 Set MyFile = Nothing
118 fProperties = aPropName
119 Set vShell = Nothing
120 Set vFolder = Nothing
121 Set vFolderItem = Nothing
End Function
Last edited: