Function lines(txtpath As String, ByVal startline As Integer, linenum As Integer) As String 'txtpath 文件中从startline开始的linenum行内容。
lines = ""
Dim filetxt As String, x As Variant, i As Integer
filetxt = String(FileLen(txtpath), " ")
Open txtpath For Binary As 1
Get #1, , filetxt
Close 1
x = Split(filetxt, vbCrLf)
If startline > UBound(x) Then MsgBox "行溢出", 64, "err!": Exit Function
If startline <= UBound(x) Then
If startline + linenum <= UBound(x) Then
For i = startline To startline + linenum - 1
lines = lines & x(i) & " "
Next
Else
For i = startline To UBound(x)
lines = lines & x(i) & " "
Next
End If: End If