Textbausteine für Memofeld ?

Hallo,
Ich habe eine Memofeld in dem der Benutzer Texte eingibt.

Nun soll er die Möglichkeit haben an beliebigen Stellen TexteBausteine einfügen zu können.

Wie geht das ?

Ich könnte das mit SendKeys machen gibt es da noch was besseres ?

Danke

Hallo,

etwa so:

In einem Standardmodul:

Option Explicit

Public Function fktTextInsert(strText As String)
Dim StrPre As String, strSuf As String, lngInsertPos As Long
Dim ctl As Control
Set ctl = Screen.ActiveControl
lngInsertPos = ctl.SelStart
StrPre = Left(ctl.Text, lngInsertPos)
strSuf = Mid(ctl.Text, lngInsertPos + 1)
ctl.Value = StrPre & strText & strSuf
ctl.SelStart = lngInsertPos
ctl.SelLength = Len(strText)
End Function

und für ein Form-Textfeld:

Private Sub Textfeld1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Shift = 4 Then 'Alt-Taste gedrückt
fktTextInsert (Date)
End If
End Sub

schreibt den Text (akt. Datum) an die Schreibmarkeposition, wenn man beim „Klicken“ in das Textfeld die Alt-Taste gedrückt hält.

Viele Grüße vom Bodensee
Franz, DF6GL

PS: Feedback erwünscht!