Web Browser navigation to local html file (1 Viewer)

Ray Spackman

Registered User.
Local time
Today, 07:04
Joined
Feb 28, 2008
Messages
52
This is driving me nuts and have researched multiple threads on multiple sites and still cannot get this to work.

I have 1 form with two controls on it (a text box named path, and a web browser control). I am trying to use use vba code in the forms oncurrent event and the [path] control afterupdate event to get the web browser to navigate to text located in the [path] control ( which is the UNC path of the file). Not having any luck and have been working with webbrowser.navigate ???????????? Can someone help please?
Thank you in advance.
 

John Big Booty

AWF VIP
Local time
Tomorrow, 00:04
Joined
Aug 29, 2005
Messages
8,262
Have a look at the Follow method, your code might look something like
Code:
FollowHyperlink "C:\Documents and Settings\User Name\Desktop\Document Name.doc"
 

Ray Spackman

Registered User.
Local time
Today, 07:04
Joined
Feb 28, 2008
Messages
52
Okay tried both of these:

WebBrowser2.FollowHyperlink Me.path
and
FollowHyperlink Me.path

Niether on worked.

The UNC path is actually the value of the txt control [path] on the form.
 

Ray Spackman

Registered User.
Local time
Today, 07:04
Joined
Feb 28, 2008
Messages
52
Okay got it working with this code:

WebBrowser2.Navigate Me.path

The problem was this: in the text value rflecting the UNC path, I had not included the file extension of .htm. Edited the value from C:\......\test to C:\...test.htm and it worked although it came up with 3 script errors which I would like to get rid of but do not have any clue as to how to achieve this. Continued help would be appreciated.
 

munirshahzad

New member
Local time
Today, 19:04
Joined
Jun 25, 2020
Messages
1
Me.wbc1.ControlSource = "=(""c:\Users\dell\AppData\Local\Temp\932020125808PM.html"")"
OR
Me.wbc1.ControlSource = "=(""" & links & """)"
 

Users who are viewing this thread

Top Bottom