Visual Basic > Code Snippets
Save a webpage to a file
Save a webpage to a file 'add a reference to the Microsoft Internet Transfer Control Private Sub Command1_Click() Dim URL() As Byte 'set protocol to HTTP Inet1.Protocol = icHTTP Inet1.URL = "http://www.microsoft.com" ' Retrieve the HTML data into a byte array. URL() = Inet1.OpenUrl(Inet1.URL, icByteArray) ' Create a file for the data. Open "webpage.htm" For Binary Access Write As #1 Put #1, , URL() Close #1 End Sub
Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows