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

相关文章: