thanks, but i found a simpler solution
Dim intCursor As Integer = txtInput.SelectionStart
Dim intStart As Int32 = CInt(IIf(intCursor - 1 < 0, 0, intCursor - 1))
Dim intStop As Int32 = intCursor
intStop = txtInput.Text.IndexOf(SingleSpace, intCursor)
intStart = txtInput.Text.LastIndexOf(SingleSpace, intCursor)
If intStop < 0 Then
intStop = txtInput.Text.Length
End If
If intStart < 0 Then
intStart = 0
End If
debug.print( txtInput.Text.Substring(intStart, intStop - intStart).Trim)