Example
The following example replaces the second and third characters of the selected text with X's, then concatenates the text "Hello" to the selected text.
C++
CString buf;
m_Spread.SetSelStart(2);
m_Spread.SetSelLength(2);
m_Spread.SetSelText("XX");
// Concatenate the word "Hello" to the currently selected text
buf = m_Spread.GetSelText( );
buf+="Hello";
m_Spread.SetSelText(buf);
Visual Basic
fpSpread1.SelStart = 2
fpSpread1.SelLength = 2
fpSpread1.SelText = "XX"
' Concatenate the word "Hello" to the currently selected text
fpSpread1.SelText = fpSpread1.SelText + "Hello"