Function GetSource(sURL) As String


Dim xmlhttp As Object
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")


onerror goto haveError

xmlhttp.Open "GET", sURL, False
xmlhttp.send
GetSource = xmlhttp.responseText
Exit Function
haveError:
GetSource = "Error: " & Err.Description
End Function


Sub test()
MsgBox GetSource("http://www.google.com")
End Sub


Tim



"Joey Lichtenstein" <joey_l@NOSPAMxnet.com> wrote in message
news:e1sdl1$sbc$1@new7.xnet.com...
>
> I know how to do the basic:
>
> open "c:\file.txt" for Input As #1
>
> is it possible to open a web site for text input, and read the html code
> as text into VBA? What would the format for the filename be?
>
> Thanks so much in advance!
>
> Joey
>