PROCEDURE SetFontFromString() LPARA tcFont LOCAL cName, nSize, cAttrib, nPos1, nPos2 LOCAL lnPos, lnLength WITH THISFORM.oleRichText IF !EMPTY(tcFont) AND OCCURS(",",tcFont) >= 2 && save current selection lnPos = .SelStart lnLength = .SelLength && now select all text .SelStart = 0 .SelLength = LEN(.TextRTF) nPos1 = AT(",",tcFont,1) nPos2 = AT(",",tcFont,2) cName = LEFT(tcFont,nPos1-1) .SelFontName = cName nSize = VAL( SUBSTR(tcFont, nPos1 + 1, nPos2 - nPos1) ) .SelFontSize = nSize cAttrib = SUBSTR( tcFont+" ", nPos2 + 1 ) .SelBold = IIF("B" $ cAttrib,.T.,.F.) .SelItalic = IIF("I" $ cAttrib,.T.,.F.) .SelUnderline = IIF("U" $ cAttrib,.T.,.F.) && go back to previous selection .SelStart = lnPos .SelLength = lnLength ENDIF ENDWITH ENDPROCI hope this helps,