Applies to

RichTextEdit controls


The SelectedStartPos property specifies the starting position in a selected text string.


Typically, you use the SelectedStartPos property to set the starting position of a selected text string to the first letter of a word that is flagged by a supported ActiveX spell checking control.

See the section called “Implementing Rich Text” in Application Techniques for more information about spell checking text in RichTextEdit controls.

In a painter

The SelectedStartPos property cannot be set in a design-time painter.

In scripts

The SelectedStartPos property takes a long value.

The following code in a ReplaceWord event for the Wintertree Software WSpell ActiveX control sets the starting position in the text string that is being spell checked to the offset position of a misspelled word. After setting the starting position, the SelectedTextLength setting causes the entire misspelled word to be highlighted, and the ReplaceText call replaces it with a word that the user selects in a WSpell dialog box.

 string str
 str = wspell.object.MisspelledWord
 rte_1.SelectedStartPos = wspell.object.WordOffset 
 rte_1.SelectedTextLength  = Len(str)