i'm not sure how to call this code. what should i put for the "lColor" parameter?
VB Code:
Public Sub HighLight(RTB As RichTextBox, lColor As Long) 'add new color to color table 'add tags \highlight# and \highlight0 'where # is new color number Dim iPos As Long Dim strRTF As String Dim bkColor As Integer With RTB iPos = .SelStart 'bracket selection .SelText = Chr(&H9D) & .SelText & Chr(&H81) strRTF = RTB.TextRTF 'add new color bkColor = AddColorToTable(strRTF, lColor) 'add highlighting strRTF = Replace(strRTF, "\'9d", "\up1\highlight" & CStr(bkColor) & "") strRTF = Replace(strRTF, "\'81", "\highlight0\up0 ") .TextRTF = strRTF .SelStart = iPos End With End Sub
Added green "resolved" checkmark - Hack




Reply With Quote