pasensyoso_manigbas
Well-known member
- Joined
- May 19, 2006
- Messages
- 64
- Programming Experience
- Beginner
Good day mods!
Excuse me, for the title, I just couldn't find the right words to say it but, the thing is, I just want to make a certain word inside a paragraph bold. The word will be automatically set to bold in runtime. See for example the words 'John' shall be all set to bold.
Here is the code:
tempstr = tempstr.Replace(vbTab, "")
Dim secstr As String = tempstr.Replace(Chr(10), " ")
str = Split(secstr, " ")
for each x in str
select case x
case Is ="John"
txtpara.SelectionStart = txtpara.Find(x)
txtpara.SelectionFont = boldfont
end select
next
the output of the above code is, it only makes the first occurence bold. All other word "John" are just set to Regular text when what I want is to make it all bold.
What is lacking? I used the "for each loop" to visit all the words.
Any help?
Excuse me, for the title, I just couldn't find the right words to say it but, the thing is, I just want to make a certain word inside a paragraph bold. The word will be automatically set to bold in runtime. See for example the words 'John' shall be all set to bold.
Here is the code:
tempstr = tempstr.Replace(vbTab, "")
Dim secstr As String = tempstr.Replace(Chr(10), " ")
str = Split(secstr, " ")
for each x in str
select case x
case Is ="John"
txtpara.SelectionStart = txtpara.Find(x)
txtpara.SelectionFont = boldfont
end select
next
the output of the above code is, it only makes the first occurence bold. All other word "John" are just set to Regular text when what I want is to make it all bold.
What is lacking? I used the "for each loop" to visit all the words.
Any help?