Public Function GetStringBetween(ByVal InputText As String, _
ByVal starttext As String, _
ByVal endtext As String)
Dim lnTextStart As Long
Dim lnTextEnd As Long
lnTextStart = InStr(StartPosition, InputText, starttext, vbTextCompare) + Len(starttext)
lnTextEnd = InStr(lnTextStart, InputText, endtext, vbTextCompare)
If lnTextStart >= (StartPosition + Len(starttext)) And lnTextEnd > lnTextStart Then
GetStringBetween = Mid$(InputText, lnTextStart, lnTextEnd - lnTextStart)
Else
GetStringBetween = "ERROR"
End If
End Function
Dim xa As String
Dim x As String = WebBrowser1.DocumentText
Usage
xa = GetStringBetween(x, TextBox1.Text, TextBox2.Text)
MsgBox(xa)
I have tried many many diffrent ways to try to get all strings between 2 other strings with for each etc the site has more then 1 string with those 2 strings but i just get the first string between 2 strings help sorry its hard to explain :/