Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load local file in webbrower with AxWebBrowser1

Status
Not open for further replies.

ralphtrent

Programmer
Joined
Jun 2, 2003
Messages
958
Location
US
Hi
i have an app that uses the AxWebBrowser1 object. I write an html file to the client and then out like to open the file. Currently the only way the to view the file is if I hardcode the path to the file, but since I want to include an install for this program, I will never know where the file lives. What is the work around to do this? I do not want to put the html file in the temp directory. When I do this:
Code:
AxWebBrowser1.Navigage("file://..\html\file.html")
I get the "Action Cancelled" page!


Thanks
RT
 
Try this:

AxWebBrowser1.Navigage(Application.StartupPath & "\html\file.html")

Note that when developing an application, every time you run it the IDE compiles an .exe and puts in the "bin" directory. For example, if you are developing your app in C:\Projects\MyApp, the .exe. would be compiled in C:\Projects\MyApp\bin. So, any file you create using Application.StartupPath will be in the C:\Projects\MyApp\bin directory.


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top