How to select from ... too ..

  • To select an area of text with a given (integer) start position and a certain length simply use SetSelPosLen.

    But in many cases you will want to select from a certain position in the text to another position which is marked by some text or an object.

    Here the property <TWPRichText>.TextCursor.SelectText comes in action.

    If this property is set to true all the text which lies between the current cursor position and the new cursor position is selected. This works alsoso in reverse direction, when you move the cursor backwards.

    Example:

    Delete the hyperlink the cursor is located within and the enclosed text: