Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[blue]Option Explicit
Private Sub Command1_Click()
RichTextBox1.Text = "hello there" & vbCrLf & "this is a" & vbCrLf & "test to show how" & vbCrLf & "to see what is in selected line"
End Sub
Private Sub RichTextBox1_Click()
Debug.Print Split(RichTextBox1.Text, vbCrLf)(RichTextBox1.GetLineFromChar(RichTextBox1.SelStart))
End Sub[/blue]
[blue]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 WM_USER = &H400&
Private Const EM_GETOLEINTERFACE = (WM_USER + 60)
Private Sub Command1_Click()
RichTextBox1.Text = "hello there" & vbCrLf & "this is a" & vbCrLf & "test to show how" & vbCrLf & "to see what is in selected line"
End Sub
Private Sub RichTextBox1_Click()
Dim myIUnknown As Object
Dim TextRange As ITextRange
Dim tomDoc As ITextDocument
SendMessage RichTextBox1.hwnd, EM_GETOLEINTERFACE, 0&, myIUnknown
Set tomDoc = myIUnknown
Set TextRange = tomDoc.Selection
TextRange.Expand tomLine
Debug.Print TextRange.Text
End Sub[/blue]