Code:
Dim sFile As String
Dim sLines() As String
Dim nFile As Integer
Dim sCont As String
Dim nCount As Long
sFile = "c:\list.dat"
nFile = FreeFile
sCont = Space$(FileLen(sFile))
Open sFile For Binary As nFile
Get nFile, 1, sCont
Close nFile
sLines = Split(sCont, vbCrLf)
nCount = UBound(sLines) + 1
Debug.Print "you have " & nCount & " files in the list"
Debug.Print "item #5 is " & sLines(4)
contents of [tt]c:\list.dat[/tt]
[ignore]
N:\[03] Metallica - Holier Than Thou.mp3
N:\[02] Metallica - Sad But True.mp3
N:\[01] Metallica - Enter Sandman.mp3
N:\[04] Metallica - The Unforgiven.mp3
N:\[05] Metallica - Wherever I May Roam.mp3
N:\[06] Metallica - Don't Tread On Me.mp3
N:\[07] Metallica - Through The Never.mp3
N:\[08] Metallica - Nothing Else Matters.mp3
N:\[09] Metallica - Of Wolf And Man.mp3
N:\[10] Metallica - The God That Failed.mp3
N:\[11] Metallica - My Friend Of Misery.mp3
N:\[12] Metallica - The Struggle Within.mp3
[/ignore]
output:
[ignore]
you have 12 files in the list
item #5 is N:\[05] Metallica - Wherever I May Roam.mp3
[/ignore]