Web Browser navigation to local html file

Ray Spackman

Registered User.
Local time
Today, 04:34
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.
 
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"
 
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.
 
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.
 
Me.wbc1.ControlSource = "=(""c:\Users\dell\AppData\Local\Temp\932020125808PM.html"")"
OR
Me.wbc1.ControlSource = "=(""" & links & """)"
 

Users who are viewing this thread

Back
Top Bottom