Option Strict On Question

  • Thread starter Thread starter Timmy
  • Start date Start date
T

Timmy

VB.Net Standard 2003, Win2k Pro

The following code generates the late binding msg "Option Strict On
disallows late binding". How do I correct this and still have Strict On?

Thanks,

GG

Option Strict On
~
~ code
~
Private Sub AxWebBrowser1_DownloadComplete(ByVal sender As Object, ByVal e
As System.EventArgs) Handles AxWebBrowser1.DownloadComplete

'rtbHTML is a richtextbox on a form
rtbHTML.Text = AxWebBrowser1.Document.documentElement.innerhtml

End Sub
 
Hi,

Add a reference to Microsoft HTML object library in the com tab.

Private Sub AxWebBrowser1_DownloadComplete(ByVal sender As Object, ByVal e
As System.EventArgs) Handles AxWebBrowser1.DownloadComplete
Dim doc As mshtml.HTMLDocumentClass

doc = CType(AxWebBrowser1.Document, mshtml.HTMLDocumentClass)

RichTextBox1.Text = doc.documentElement.innerHTML
End Sub

Ken
 
Excellent. Thank you very much Ken.

GG

Ken Tucker said:
Hi,

Add a reference to Microsoft HTML object library in the com tab.

Private Sub AxWebBrowser1_DownloadComplete(ByVal sender As Object, ByVal e
As System.EventArgs) Handles AxWebBrowser1.DownloadComplete
Dim doc As mshtml.HTMLDocumentClass

doc = CType(AxWebBrowser1.Document, mshtml.HTMLDocumentClass)

RichTextBox1.Text = doc.documentElement.innerHTML
End Sub

Ken
 
Back
Top