I have a rich text control with the following code:
With RtfBox
.SelStart = 10
.SelLength = 5
.SelColor = vbRed
.Text = .Text & "text"
End With
The problem is: after I add another text I loose the previous format.
Thanks.
Printable View
I have a rich text control with the following code:
With RtfBox
.SelStart = 10
.SelLength = 5
.SelColor = vbRed
.Text = .Text & "text"
End With
The problem is: after I add another text I loose the previous format.
Thanks.
What's your code?
I have tried your code but I don't see the problem.
Works just fine
Try using the .SelText property to allow .SelBold, .SelColor, .SelAlignment and all others format property to be applied only with the .SelText value, here is a quick example:
JeffBCode:With Me.RichTextBox1
.Text = ""
.SelStart = 0
.SelLength = 0
.SelColor = vbRed
.SelText = "RED"
.SelStart = 3
.SelLength = 0
.SelColor = vbBlue
.SelText = "BLUE"
End With
After you format the text, add some more text and you'll see that the previous format disappears.
Thanks
Thanks
It works.