i keep on getting an error on this Code (Text): newmsg = FindString(strhtml, "class='mainmenu'>", "new message") but i cant seem to figure out what the problem is.
use this function NOT MINE Code (Text): Public Function FindString(TextToSearch As String, StartText As String, EndText As String, Optional StartPos As Long = 1) Dim sText As Long, eText As Long sText = InStr(StartPos, TextToSearch, StartText, vbTextCompare) + Len(StartText) eText = InStr(sText, TextToSearch, EndText, vbTextCompare) If sText >= Len(StartText) And eText > sText Then FindString = Mid$(TextToSearch, sText, eText - sText) Else FindString = "" End If End Function
for findstring could i do this? Code (Text): event = FindString(strhtml, "</b><p><p>", "<p><form") if event= "" then log.additem ("nothing happened") else: log.AddItem (event) i am trying to display nothing happened if the string doesnt appear, and if it does, i want it to display what the strings value is, would i use that code?