i have a rich textbox and it contain a text, and i need to select the last line automatically by code. and i need to put a picture in the last line.
any idea to help me.

i use the below code :-

PHP Code:
' in module 
Option Explicit
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
    ByVal wMsg As Long, ByVal wParm As Long, IParam As Any) As Long
    Public Const WM_PASTE = &H302
    Private Const EM_GETLINECOUNT = &HBA

in button

Dim LineCount 
As Long
.SetData Image1.Picture
SendMessage RichTextBox1
.hwndWM_PASTE0&, 0
this code is work but the picture come in the top( before text)

and i need to put it after the last line of text.

many thanks.