I would like to use StyledText to get what I used to do with SelText.
The problem I have is StyledText.Font is not working currently.
This is an image of what worked for SelText (before I started screwing with it): Old SelText .
If needs be, I’ll explain my variables, but this is either a technical I did it wrong or …
This is a portion of the text for this entry. The area in between and is supposed to be bold and underlined. The Pilcrow are replacement for EOL.
The field I am trying to get to work correctly is called HomeWord. This works because I am not “playing” with the text as in setting some area to Bold and Underlined.
I can only get StyledText to work partway. Here is one image: Editing
And this is the code:
vL = Len(stkOfStrgs(0))-Len(EOL)
vR = Len(strFDisplay)-1
tCont.SelTextColor = RGB(255,255,255)
tCont.StyledText.Size(0, vL) = fSize
tCont.StyledText.Size(vL+Len(EOL), vR-vL) = SizeOfFontMin
tCont.StyledText.Bold(0, vR) = False
tCont.StyledText.Underline(0, vR) = False
This image shows the same text but I am trying to highlight the word mouth, but instead the whole StyledText segment loses its font.
Editing
This is the code for this section:
str = Replace(stkOfStrgs(0), Prm0L, "")
vR = InStr(str, Prm0R)-1
str = Left(str, vR)
tCont.StyledText.Bold(0, vR) = True
tCont.StyledText.Size(0, vR) = fSize
tCont.StyledText.Underline(0, vR) = True
str = str + Mid(stkOfStrgs(0), (InStr(stkOfStrgs(0), Prm0R) + Len(Prm0R)))
tCont.StyledText.Text = str + stkOfStrgs(1)
tCont.StyledText.Size(0, Len(str)) = fSize
tCont.StyledText.Size(Len(str)+1, Len(stkOfStrgs(1))-1) = SizeOfFontMin
tCont.StyledText.Font(Len(str)+1, Len(stkOfStrgs(1))-1) = DispFont
tCont.StyledText.TextColor(0, Len(stkOfStrgs(1))-1) = RGB(0, 0, 0)