I'm using webbrowser to for nagivation and displaying the contents of web pages. But how do I get webbrowser to save the pages onto disk and preferably without the HTML coding only ascii??
Many thanks for any ideas,
Eero
Printable View
I'm using webbrowser to for nagivation and displaying the contents of web pages. But how do I get webbrowser to save the pages onto disk and preferably without the HTML coding only ascii??
Many thanks for any ideas,
Eero
Use this code to save a page:
Or this one to save the whole web site.Code:Text1.Text = WebBrowser1.Document.documentElement.innerHTML
Code:WebBrowser1.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_DODEFAULT
And use this code to remove the tags.
Code:Private Function Tagless(ByVal Text As String) As String
Dim i As Integer
Dim bInTag As Boolean
Dim strTmpStr As String
bInTag = False
For i = 1 To Len(Text)
If Not bInTag Then
If Mid(Text, i, 1) <> "<" Then
strTmpStr = strTmpStr & Mid(Text, i, 1)
Else
bInTag = True
End If
Else
If Mid(Text, i, 1) = ">" Then
bInTag = False
End If
End If
Next
TagLess = strTmpStr
End Function
Private Sub Form_Load()
Dim strHTML As String
strHTML = "<HTML>" & _
"<HEAD>" & _
"<TITLE>Test Page</TITLE>" & _
"</HEAD>" & _
"<BODY>" & _
"Hello World!" & _
"</BODY>" & _
"</HTML>"
MsgBox Tagless(strHTML)
End Sub