P
Pat Mac
Does anyone have a working example of the HTMLDocument.createDocumentFromUrl
function?? The few examples I found on the net don't seem to work. Here's
a piece of code that seems to go through some unnecessary steps but was
supposed to work, but for me it throws an "unknown error" exception.
Any help would be appreciated.
Dim doc1 As mshtml.IHTMLDocument2 ' HTMLDocument()
Dim docU As New mshtml.HTMLDocument()
Dim doc2a As mshtml.IHTMLDocument2 'mshtml.HTMLDocument()
Dim doc2 As mshtml.IHTMLDocument2
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnStart.Click
Try
doc1 = docU
doc2a = docU
doc2a.write("<html></html>")
doc2a.close()
'This is the line that generates the exception.
doc2 = doc1.createDocumentFromUrl("http://www.yahoo.com", "null")
While doc2.readyState <> "complete"
Application.DoEvents()
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
function?? The few examples I found on the net don't seem to work. Here's
a piece of code that seems to go through some unnecessary steps but was
supposed to work, but for me it throws an "unknown error" exception.
Any help would be appreciated.
Dim doc1 As mshtml.IHTMLDocument2 ' HTMLDocument()
Dim docU As New mshtml.HTMLDocument()
Dim doc2a As mshtml.IHTMLDocument2 'mshtml.HTMLDocument()
Dim doc2 As mshtml.IHTMLDocument2
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnStart.Click
Try
doc1 = docU
doc2a = docU
doc2a.write("<html></html>")
doc2a.close()
'This is the line that generates the exception.
doc2 = doc1.createDocumentFromUrl("http://www.yahoo.com", "null")
While doc2.readyState <> "complete"
Application.DoEvents()
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub