我的代码:
Const ForReading = 1
x=0
on error resume next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("Test.txt", ForReading)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
arrName = Split(strLine, vbTab)
msgbox(arrName(x))
x = x+1
Loop
文件如下所示
Name 2nd name
ABDELMAGID A SMITH & LISA S
ABDELMAGID A SMITH & LISA S
CLEVELAND SANDY LEE
CLEVELAND SANDY LEE
WHALEN STEPHEN H & JOAN L
WHALEN STEPHEN H & JOAN L
BANK TWO OF VIRGINIA INC C/O DOE JOHN
BANK TWO OF VIRGINIA INC C/O DOE JOHN
BANK TWO OF VIRGINIA INC C/O DOE JOHN
SMITH JOHN ELLIS JR
JONES JOHN III