Const ForReading = 1
Dim message
Dim fs, ts
set fs = CreateObject("Scripting.FileSystemObject")
set ts = fs.OpenTextFile("1.txt", ForReading)
Do Until ts.AtEndOfStream
message = ts.ReadLine '即使是空行,也会被读一次
if message <> "" Then
MsgBox message
End if
Loop
ts.Close
set ts = Nothing
set fs = Nothing
转载于:https://www.cnblogs.com/joeblackzqq/archive/2011/02/26/1966009.html