tags:

views:

22

answers:

2

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

Thanks in advance - Miss subanki

A: 

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. ??

subanki
A: 

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
Adam Dempsey
thanx friend i figured that too but forgot to post here. :D, thanx again
subanki