|
-
Dec 17th, 2000, 09:53 AM
#1
Thread Starter
Hyperactive Member
Hi!
Anyone know how to save a webpage to a HTML file stored on my computer? Can this be done with the Microsoft Internet Controls (A ref, not a control)?
This should be done without any msgbox ,etc....
/Smirre
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
-
Dec 17th, 2000, 12:40 PM
#2
Member
hi yes you can do it with IE5.ocx in VB , what you need to do is right click on the page you want and then save it in a folder , remember this ocx is the same ocx like IE5
i hope this helps
InfoWarrior
Waheed Rafiq (ICT Technician):
Network +
-
Dec 17th, 2000, 09:21 PM
#3
Well, after about 2 minutes of sitting and using my brain I came up with up with an idea.
Retrieve -> HTML Source -> Write to file -> .htm (or .html).
^I thought of all this..all by myself! 
And you said referenced? Ok.
Code:
Dim ie As New InternetExplorer
Private Sub Command1_Click()
Dim strHTML As String
strHTML = ie.Document.documentElement.innerHTML
Open "C:\htmlfile.htm" For Output As #1
Print #1, strHTML
Close #1
End Sub
But you'd have to go to the page first.
If you would rather not go to the page first, you could look into the URLDownloadToFile API function.
Code:
DownloadFile "http://www.vb-world.net", "c:\vbworld.htm"
But I like the first way better, I think it'd be much quicker. Plus, you could always keep the referenced browser's visibility to false and just surf to it and get it's source. I think it'd be much quicker than using the API function.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|