Wondering, what's the best way to display text from a website to your form?
Printable View
Wondering, what's the best way to display text from a website to your form?
webbrowser control.
Aside from using a webbrowser control.
Like if I just want to display some text from a website to a label on my form.
You can use Inet for that.
Add a Command button, a label and the Inet control (Microsoft Internet Transfer Control in the components list) to your form
The code below gets the text from your starting post and shows it in a label.
Code:Private Sub Command1_Click()
Dim strText As String
Dim x As Long, y As Long
strText = Inet1.OpenURL("http://www.vbforums.com/showthread.php?t=529677")
y = InStr(1, strText, "<!-- message -->")
If y Then
x = InStr(y + 20, strText, ">")
If x Then
y = InStr(x, strText, "</div>")
If y Then
Label1.Caption = Mid$(strText, x + 1, (y - x) - 1)
End If
End If
End If
End Sub
Thanks a bunch. :)
Can you please check why the same process is not working for me at http://www.vbforums.com/showthread.php?t=529914