You can use SelRtf property to do that. It replaces text in the current selection. If ther's no selection, it inserts text at the current cursor position.
THIS.rtfControl.TextRTF.SelRtf = lcAddText
>Hello,
>
>I try to insert text into an RTF control at the cursor position, but this seems to be more difficult than I expected.
>
>The code I tried is:
>
>
THIS.rtfControl.TextRTF = ;
> SUBSTR(THIS.rtfControl.TextRTF,1, ;
> THIS.rtfControl.SelStart) + ;
> lcAddText + ;
> SUBSTR(THIS.rtfControl.TextRTF,THIS.rtfControl.SelStart + 1)
>
>Now the SELSTART property does not correspond to the cursor position in relation to the TextRTF value. So I would have to use THIS.rtfControl.Text instead of TextRTF, but then I loose all RTF formatting!
>
>Any ideas how to do this?
>
>Thanks for your help in advance.
--sb--