Get string from paragraph(i)

Hi everyone
I know how and i’m able to set style to paragraph inside a textarea
How can i get the string included in the (paragraph)

I must search a certain word inside the string (paragraph(i)) to apply the right style to itself
I hope be able to use the same index for paragraph(x) as text and StyledText
Thanks

Whereas textArea1.rtfdata will return the styled text, textArea1.text will return the unstyled text from the textArea.
Having typed that, I’m not sure I understand your problem. HTH

.text will return all textArea text
But i want to have each paragraph separately as string
I want to use the same index as paragraph(i)
Ex.: If i find the word “fail” inside the string of paragraph(i) then paragraph(i).styled bold
i’v step the StartPos. & Length for the purpose of my exemple… First i need the return of the paragraph index where “fail” is in string

For now i’m doing it by regex… but nothing insure me that the return of regex position in all text will match the index of paragraph defined by xojo

Correct me if I’m wrong, but TextAreas don’t have paragraphs. By which, I mean Xojo does not implement the concept of a paragraph. You must impose that upon it yourself. So there is no “index of paragraph defined by Xojo”.

The StyledText class has a concept of paragraphs.
e.g.

  Dim p As Paragraph = TextArea1.StyledText.Paragraph(i)
  Dim length As Integer = p.EndPos - p.StartPos
  Dim data As String = Mid(TextArea1.Text, p.StartPos, length)
  MsgBox(data)

Thanks Andrew
I did not have argument after Tim answer
I just found biz that

TextArea1.StyledText.ParagraphCount

can give me the count… but can’t return the content
Sorry for my bad english… Read as past sentence