'******************************************************** ' Purpose: To view HTTP CONTENT without using BROWSER ' Author : Prashant Nayak, Copy right (c) 2004 '******************************************************** ' Uses XMLHttp to retrieve content '************************************** Function RetrieveHttpContent(site) Dim XmlHttp1 on error resume next set XmlHttp1 = CreateObject("MSXML2.XMLHTTP.3.0") if err.number>0 then set XmlHttp1 = CreateObject("MSXML2.XMLHTTP.4.0") end if XmlHttp1.Open "GET", site, False Call XmlHttp1.send RetrieveHttpContent = XmlHttp1.responseText End Function ' Creates temp file for the content '************************************** Sub WriteContentToFlie(content1,textfilepath) if textFilePath ="" then textFilePath="c:\Temp\TempHttpContent.txt" end if dim filesys, filetxt Set filesys = CreateObject("Scripting.FileSystemObject") Set filetxt = filesys.CreateTextFile(textFilePath, True) call filetxt.write(content1) filetxt.close call ViewFile(textFilePath) End Sub ' Display content '************************************** Sub ViewFile(sfile) dim shellx set shellx=createobject("Shell.Application") call shellx.ShellExecute("notepad.exe", sfile, "", "open", "1") End Sub ' Main '*************************************** dim mySite mySite=InputBox("Enter URL to view content:" & vbcrlf & "(Limited to Message Box dialog area.)" & vbcrlf & vbcrlf & "[Author: Prashant Nayak]" , "Http Content Viewer", "http://www.google.com") if mysite<>"" then dim content content=RetrieveHttpContent(mySite) mySite=InputBox("Enter Path and FileName to write content" & vbcrlf & "(Author: Prashant Nayak)", "Http Header Viewer", "C:\Temp\Temp.txt") if mySite<>"" then WriteContentToFlie content,mysite end if end if