Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Navigate2 method in web browser control

224 views
Skip to first unread message

Richard Jonas

unread,
Mar 4, 2002, 2:28:03 PM3/4/02
to
Hi,

I am developing an ActiveX control that incorporates a web browser
control. I am trying to navigate using this, but I am having some
problems.

The following works:
webbrowser1.Navigate2 "http://www.microsoft.com"

This works and shows a directory listing
webbrowser1.Navigate2 "c:/"

This does not work:
webbrowser1.Navigate2 "c:/test.html"

However, entering c:/test.html in the title bar of my stand alone web
browser (IE5.5) works OK.

Does anyone have any ideas as to what I might be doing wrong here and
how to navigate to "c:/test.html" (I am using VB6 and IE5.5 on NT
4.0)

Thanks,

Richard

rdj AT btopenworld DOT com

Equinox Tetrachloride

unread,
Mar 4, 2002, 3:25:30 PM3/4/02
to
"Richard Jonas" <r...@dircon.co.uk> wrote:

> This works and shows a directory listing
> webbrowser1.Navigate2 "c:/"
> This does not work:
> webbrowser1.Navigate2 "c:/test.html"
> However, entering c:/test.html in the title bar of my stand alone web
> browser (IE5.5) works OK.

I'm not familiar with the WebBrowser control, but I think you might need to
specify the file: protocol. Just as www.microsoft.com is really
http://www.microsoft.com (the protocol is HTTP), so c:/test.html is really
file:///c:/test.html

Just a suggestion - I can't guarantee it will work.

Eq.

--

Equinox Tetrachloride
Not sociophobic, just avoiding you.
www.cl4.org - www.insecurities.org


mayayana

unread,
Mar 4, 2002, 8:16:34 PM3/4/02
to
Navigate works fine. I've never used Navigate2 but my understanding is that
it's only for
Windows namespace navigation.
WB.Navigate "C:\test.html", 14
will open test.html and not record it in History or check the cache for it.

flags:

navOpenInNewWindow 1 Open the resource or file in a new window.

navNoHistory 2 Do not add the resource or file to the
history list. The new page replaces the current page in the list.

navNoReadFromCache 4 Do not read from the disk cache for this
navigation.

navNoWriteToCache 8 Do not write the results of this navigation to the
disk cache

--
--
Richard Jonas <r...@dircon.co.uk> wrote in message
news:ff53c0c7.02030...@posting.google.com...

Richard Jonas

unread,
Mar 5, 2002, 1:17:30 PM3/5/02
to
Thank you for taking the time to reply. I have experimented with the
flags as you suggested, and found that if I set the navOpenInNewWindow
bit, the file will open correctly in a new browser (the other settings
make little difference).

I then created an application to contain the control (not the web
browser), and this worked. I think the problem was that I was using a
web browser to debug an ActiveX control that contained a web browser.

Using Navigate or Navigate2 seems to make little difference. Also
thanks to for the suggestion of prefixing the URL with "file://", but
this did not affect things in this case.

Regards,

Richard.

"mayayana" <maya...@mindspring.com> wrote in message news:<a61692$dfo$1...@slb6.atl.mindspring.net>...

0 new messages