[Visual Basic 2010] Open with
Solved
Anonymous user
-
Anonymous user -
Anonymous user -
Hello,
I am looking for a code that would allow me to launch a file locally with Internet Explorer...
Example: start iexplore.exe "index.htm" (This code doesn't work, of course)
Shell("index.htm") with iexplore.exe
Thank you for getting back to me. To make it easier, the files index.htm and iexplore.exe are located relatively in the program's folder...
Bye!
Configuration: Windows 7 / Chrome 24.0.1312.57
I am looking for a code that would allow me to launch a file locally with Internet Explorer...
Example: start iexplore.exe "index.htm" (This code doesn't work, of course)
Shell("index.htm") with iexplore.exe
Thank you for getting back to me. To make it easier, the files index.htm and iexplore.exe are located relatively in the program's folder...
Bye!
Configuration: Windows 7 / Chrome 24.0.1312.57
2 réponses
Hello
Something like? Then you need to consider the path
System.Diagnostics.Process.Start("iexplore", "path to the html file")
Well, it's not necessarily very practical, I would recommend uploading this file to a web server, even a free one, and using a regular URL
Passionate about computers and video games.
It's always nice to get a "thank you", even when the response given is good and your problem is solved :)
Something like? Then you need to consider the path
System.Diagnostics.Process.Start("iexplore", "path to the html file")
Well, it's not necessarily very practical, I would recommend uploading this file to a web server, even a free one, and using a regular URL
Passionate about computers and video games.
It's always nice to get a "thank you", even when the response given is good and your problem is solved :)
Yes, but my file is an HTM coded with Hot Potatoes (form/form exercises for teaching) and it would need to be recoded completely <- No thanks...
Thanks for your quick response, I'm testing this right away.
------> FAIL !! It's almost there, but now the button opens Internet Explorer and does a Google search for: "index.htm" and not my local file!!!
Any other ideas?
Thanks for your quick response, I'm testing this right away.
------> FAIL !! It's almost there, but now the button opens Internet Explorer and does a Google search for: "index.htm" and not my local file!!!
Any other ideas?
Ok, I made some code for you
The HTML file needs to be in the same directory as the application (although if you want to put it elsewhere, you just need to change part of the assignment to the variable)
Is it a click on a button that executes the action?
If so, in the sub of your button click:
Dim ApplicationPath As String 'we create the variable to hold the absolute path
ApplicationPath = Application.StartupPath + "\index.html" 'we retrieve and assign the path to this variable + the HTML file
System.Diagnostics.Process.Start("iexplore", ApplicationPath) 'we launch with the variable
The HTML file needs to be in the same directory as the application (although if you want to put it elsewhere, you just need to change part of the assignment to the variable)
Is it a click on a button that executes the action?
If so, in the sub of your button click:
Dim ApplicationPath As String 'we create the variable to hold the absolute path
ApplicationPath = Application.StartupPath + "\index.html" 'we retrieve and assign the path to this variable + the HTML file
System.Diagnostics.Process.Start("iexplore", ApplicationPath) 'we launch with the variable