Option Strict On Question

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
 
K

Ken Tucker [MVP]

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
 
G

Gordon

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top