Koen Piller
Programmer
Hi,
With RTF you can search and highlight for words in your RTF-text. However the highlight function is not as the default highlight in Word or Excel: it changes the forecolor to a given color and not the backcolor. Anybody to give me the code to change the highlight to true highlight?
I am using these procedures now:
Anyone who has the code to change the highlight to as it should be?
Stay healthy,
Koen
With RTF you can search and highlight for words in your RTF-text. However the highlight function is not as the default highlight in Word or Excel: it changes the forecolor to a given color and not the backcolor. Anybody to give me the code to change the highlight to true highlight?
I am using these procedures now:
Code:
PROCEDURE SEARCHIT
* cmd Search
Local ;
lcFindExpression As String, ;
liExpressionFound As Integer
If Empty(Thisform.Text1.Value)
Return
Endif
With Thisform
m.lcFindExpression = Alltrim(.Text1.Value)
m.liExpressionFound = .oleDetails.Find(m.lcFindExpression ,0, -1)
If m.liExpressionFound >-1
.nStart = m.liExpressionFound + 1
Endif
Endwith
ENDPROC
PROCEDURE SEARCHALL
Local ;
lcExpressionSought As String, ;
liFound As Integer
If Empty(Thisform.Text1.Value)
Return
Endif
m.lcExpressionSought = Alltrim(Thisform.Text1.Value)
With Thisform
.nStart = 0
m.liFound = 0
Do While m.liFound >=0
m.liFound = .oleDetails.Find(m.lcExpressionSought ,.nStart, -1)
If m.liFound >-1
.nStart = m.liFound + 1
* highlight it
.oleDetails.SelColor = Rgb(255,0,0) &&red
.oleDetails.SelBold = .T.
Else
Exit
Endif
Enddo
Endwith
ENDPROC
Anyone who has the code to change the highlight to as it should be?
Stay healthy,
Koen