I'm trying to optimize my HTML syntax highlighting - and since people are editing in an RTB, I want to change the TextRTF, so I don't have to use SelColor and do a lot of messy stuff.
This is what I got so far:
Dim sData As String
RTF1.TextRTF = RTF1.TextRTF & vbCrLf & "{\colortbl ;\red0\green0\blue128;}"
RTF1.Text = ""
Open "C:\test.htm" For Input As #1
Do Until EOF(1)
Line Input #1, sData
RTF1.Text = RTF1.Text & sData & vbCrLf
Loop
Close #1
RTF1.TextRTF = Replace(RTF1.TextRTF, "<", "<\cf1 ")
RTF1.TextRTF = Replace(RTF1.TextRTF, ">", "\cf0 >")
RTF1.Refresh
The problem is that VB doesn't seem to change the TextRTF - the ColorTable("{\colortbl ;\red0\green0\blue128;}") doesn't get inserted and it doesnt replace the values as I want to.
I can explain the RTF code if you want me to(though it's pretty obvious - try saving an RTF where you've set some different SelColors)
Does anybody have an idea on how to fix this ?
Cheers!