'把文本文件装入一个数组,每行为一个数组元素
Open App.Path & "\test.txt" For Input As #1
Dim strArray() As String
Dim i As Long
i = 0
Dim strLine As String
Do While Not EOF(1) ' 循环至文件尾。
Input #1, strLine
ReDim Preserve strArray(i)
strArray(i) = strLine
i = i + 1
Loop
Close #1