Results 1 to 4 of 4

Thread: Hit an URL from VB

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    Is there a function in VB to hit an URL and get back the HTML from that web page?

    I do not want to launch IE.

    Thanx

    dvst8

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    I've found the following which will do what I want:

    Code:
    Private Sub Run_Click()
    
    Dim Inet1
    
    Dim b() As Byte
    Dim intCount As Integer
    Dim strData As String
    
    Inet1.Cancel ' Stops any current operations
    
    b() = Inet1.OpenURL("http://www.vbsquare.com/index.html", icByteArray)
    
    For intCount = 0 To UBound(b) - 1
    
      strData = strData & Chr(b(intCount))
    
    Next intCount
    
    MsgBox strData
    
    
    End Sub
    but when I try to run this I get the error "Object Required" the first time I make reference to Inet1

    do I have to 'construct' the Inet object??

    (and yes I did check Microsoft Internet Controls in Components)

    ideas?

    thanks!

  3. #3
    Addicted Member
    Join Date
    Jun 2000
    Location
    Pittsburgh, PA
    Posts
    149

    transfer control

    You need to add the MS Internet Transfer Control component in vb

  4. #4
    Addicted Member
    Join Date
    Jun 2000
    Location
    Pittsburgh, PA
    Posts
    149

    added to above

    You then need to put that compnent on the form

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width