' Listing 1. Code That Reads a Text File into an Array Const ForReading = 1 Dim arrText() Dim iUpperBound Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile("foo.txt", ForReading) iUpperBound = 0 While Not ts.AtEndOfStream ReDim Preserve arrText(iUpperBound) arrText(UBound(arrText)) = ts.ReadLine iUpperBound = iUpperBound + 1 Wend ts.Close