Dim fFSO As New FileSystemObject
Dim ftext As TextStream
dim i as integer ' i 是行数
Set ftext = fFSO.OpenTextFile(Trim(ssName), ForReading)'ssName 是文档名
Do While ftext.AtEndOfStream = False
i = ftext.Line
wend
Open "c:\1.txt" For Binary As #1
strTemp = Space(LOF(1))
Get #1, , strTemp
lngCount = Len(strTemp) - Len(Replace(strTemp, vbCrLf, "*"))
MsgBox lngCount
Close #1