It depends on what "associated" mean here, and "association" here could be strong, or weak, depends on how the association is created.
If it only relies on the text position point is at exact position of the line's end point (start/end point), then you must make sure the text is drawn accurately. You can also place each pair of text/line and a group, so that the group becomes the association mechanism (i.e. even the text is moved from the line's end point slightly or significantly, the text can still be identified being associated with a line); or you can establish the association by embed XData to each pair, so the two would be linked "hardly" by data that can be examined with VBA code..
So, before you spend time to get text from associated Text entity, you might want to make sure the association between the line and the text make business sense in your CAD operation process.
If all you care is the text's position being at the line's end point, then write code to find the "associated" text entity (and then get its text string) would be fairly easy. Here are the pseudo code/process (assuming they are in ModelSpace):
Dim ent As AcadEntity
Dim txt As AcadText
Dim line As AcadLine
For Each ent In ThisDrawing.ModelSpace
If TypeOf ent Is AcadLine Then
Set line = ent
Set txt = FindConnectedText(line)
If Not txt Is Nothing Then
MsgBox "Text String: " & txt.TextString
End If
End If
Next
Function FindConnectedText(line As AcadLine) As AcadText
Dim txt As AcadText
Dim ent As AcadEntity
For Each ent in ModelSpace
If TypeOf ent Is AcadText Then
Set txt=ent
If TextAtPoint(txt.InsertionPoint, line.StartPoint) Or TextAtPoint(txt.InsertionPoint, line.EndPoint) Then
Set FindConnectedText = txt
Exit Function
End If
End If
Next
Set FindConnectedText = Nothing
End Function
Function TextAtPoint(textPoint As Variant, linePoint As Variant) As Boolean
'' You compare the 2 inputs point (3-element array of Double numbers).
'' whether they are the same or close enough, return True False
End Function
Obviously, if the business requires other more reliable "association" mechanism, the you need different code to identify the associated text entity.
HTH