Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const EM_GETLINECOUNT = &HBA
Private Sub Command1_Click()
Dim iLines As Long
iLines = SendMessage(Text1.hwnd, EM_GETLINECOUNT, 0&, 0&)