subanki
subanki

Reputation: 1429

How to navigate using WebBrowser Control

How to navigate using WebBrowser Control? I want to open a C:\file1.html... an example code would be appreciated.

Upvotes: 1

Views: 5553

Answers (2)

Adam Dempsey
Adam Dempsey

Reputation: 2962

The VB code you have is correct, that is an error with the javascript on the page you are loading, so you can use:

Private Sub Command1_Click()

WebBrowser1.Navigate2 "C:\file1.html"

End Sub

But in Form_Load set silent mode, eg:

Private Sub Form_Load()

WebBrowser1.silent = true

End Sub

Upvotes: 1

subanki
subanki

Reputation: 1429

i first put a webcomponent as mentioned in the post "How do i open a webpage" in vb6 by adatapost

Private Sub Command1_Click()

WebBrowser1.Navigate2 "C:\file1.html"

End Sub

this works but as u click on the button it pops a error..A error has occured on the scirpt of the page , line 6, Error: object expected, url: file:///C:file1/index.html, do u want to continue , yes or NO............................how to come around this error. ??

Upvotes: 1

Related Questions