Sub Sample() Dim buf As String, cnt As Integer Open "C:\Windows\Win.ini" For Input As #1 Do While Not EOF(1) Line Input #1, buf cnt = cnt + 1 Loop Close #1 MsgBox "Win.iniは" & cnt & "行です" End Sub