WebBrowser.Navigate question

ratcliffe_ic

Member
Joined
Mar 28, 2007
Messages
7
Programming Experience
Beginner
Hi, this is my first post, can anyone help with this small issue?
I have created a VB application with a webbrowser built in that displays HELP functions, the webbrowser works fine if I use the following code

WebBrowser.Navigate("c:\Documents and Settings\Ian\My Documents\VB APP\bin\help\home.htm")

When this application is put on another computer in another folder this line of code needs modifying, which I want to avoid. To get round this I have tried the following:

Dim path As String
path = CurDir()
WebBrowser.Navigate(
"path\help\home.htm")

However the webbrowser displays page not found, even though when looking at the path value it is equal to c:\Documents and Settings\Ian\My Documents\VB APP\bin

Any ideas why this is, anyone, or is there a better way of doing this.
Thanks in advance.

 
try Application.StartupPath it returns a path string
 
Thanks for that, the CurDir would have worked if I'd had the syntax correct, but the Application.StartupPath is even neater, thus:

WebBrowser.Navigate(Application.StartupPath +
"\help\Home.htm")

Thanks again
 
Back
Top