Alrighty, here you go... Copy and paste the following code...
------------------------------------------------------------
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim Var1, Var2, Var3, MyText As String
Var1 = " is good"
Var2 = " is better"
Var3 = " is the best"
MyText = "HEADING ONE" & vbCrLf
MyText &= "Property one" & Var1 & vbCrLf
MyText &= "Property one" & Var2 & vbCrLf
MyText &= "Property one" & Var3 & vbCrLf
MyText &= "HEADING TWO"
RTB.Text = MyText
MakeBold()
End Sub
Private Sub MakeBold()
Dim myFont As New Font("Tahoma", 10, FontStyle.Bold)
'Find Location of "Heading1"
Dim txt2Srch As String = "HEADING ONE"
Dim loc As Integer
loc = InStr(1, RTB.Text, txt2Srch, CompareMethod.Text)
If loc > 0 Then
'The string was found at loc
RTB.Select((loc - 1), txt2Srch.Length)
If RTB.SelectionFont.Bold = False Then
RTB.SelectionFont = myFont
End If
End If
'Repeat procedure for "HEADING TWO"
txt2Srch = "HEADING TWO"
loc = InStr(1, RTB.Text, txt2Srch, CompareMethod.Text)
If loc > 0 Then
'The string was found at loc
RTB.Select((loc - 1), txt2Srch.Length)
If RTB.SelectionFont.Bold = False Then
RTB.SelectionFont = myFont
End If
End If
'Move the caret back to start.
RTB.Select(0,0)
End Sub
------------------------------------------------------------
I think this should get you up to speed. Cheers !
Regards,
Cerebrus.
===========================================