i have fund this solution:
****** BEGIN
*** by Roberto A.
******
** todo: remove previus higlight from selection
* get background color
lcolore=GETCOLOR()
p = (256 ^ 2)
i = INT(lcolore / p)
blue = i
lcolore= lcolore - (i * p)
p = (256 ^ 1)
i = INT(lcolore / p)
green = i
lcolore= lcolore - (i * p)
red = INT(lcolore)
*create color table
tabcolore= "{\colortbl ;\red"+ALLTRIM(STR(red)) + ;
"\green"+ALLTRIM(STR(green)) + ;
"\blue"+ALLTRIM(STR(blue))+";}"
testo=thisform.oleRTF.selrtF
inizioH=tabcolore+"\highlight1 "
fineH="\highlight0"
partenza=thisform.oleRTF.selstart
lunghezza=thisform.oleRTF.sellength
*seleziono un carattere in più per vedere se è uno spazio
*difatti se è uno spazio me lo toglie e io lo devo aggiungere
thisform.olertf.sellength=lunghezza+1
IF RIGHT(thisform.olertf.seltext,1)=" "
fineH=fineH+" "
ENDIF
thisform.olertf.selstart=partenza
thisform.olertf.sellength=lunghezza
IF lunghezza<=1 then
* questo passaggio lo faccio perchè se è solo 1 carattere va in errore...
* la stringa che aggiungo credo non la vada mai ad inserire nessuno...
* speriamo bene...
*testo=thisform.oleRTF.seltext
z=thisform.oleRTF.seltext
thisform.oleRTF.seltext="%%%ctemp%%%"+z
testo=thisform.oleRTF.textRTF
thisform.oleRTF.selstart=partenza
thisform.oleRTF.sellength=lunghezza+11
testo=STRTRAN(testo,thisform.oleRTF.seltext, ;
inizioH+z+fineH)
thisform.oleRTF.textRTF =testo
testo=STRTRAN(thisform.oleRTF.textRTF,"%%%ctemp%%%",""

thisform.oleRTF.textRTF=testo
ELSE
testo=STRTRAN(testo,thisform.oleRTF.seltext,inizioH+thisform.oleRTF.seltext+fineH)
thisform.oleRTF.selrtF =testo
ENDIF
****** END
anyone have a best solution ?