Selected Text

Getting the selected text in the Formatted Text Control is relatively straightforward.

First, you have to get the Insertion Offset’s for the start and end of the selected Text. ¬†You can get that by

dim ioStart, ioEnd as FTInsertionOffset
ftc.getdoc.getselectionrange(ioStart, ioEnd)

And then you can use the GetText (overloaded) method.

dim s as string = ftc.GetDoc.GetText(ioStart, ioEnd)