Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: Colortable in RTF *Unresolved*

104| Sun, 02 Dec 2007 19:09:00 GMT| vbneo| Comments (3)
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!

Keywords & Tags: colortable, rtf, unresolved, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/80706/
 
«« Prev - Next »» 3 helpful answers below.
*BUMP*

vbneo | Mon, 03 Dec 2007 20:00:00 GMT |

*BUMP*

vbneo | Mon, 03 Dec 2007 20:01:00 GMT |

Does this (http://www.vbforums.com/showthread.php?s=&threadid=191099&highlight=colortbl) thread help? I found it by searching the forum for colortbl.

martinliss | Mon, 03 Dec 2007 20:02:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories