lauriemc Posted June 6, 2007 Posted June 6, 2007 I'm trying to open an IE Window, the IE address is actually pointed to an html file on the hard drive. I can open it fine if I use an actual web address using this code: Dim pr as process pr = pr.Start("IEXPLORE", "http://google.com") But I can't do the same thing pointing to the C drive. (Perhaps opening it on C sounds barbaric. But I have clients using laptops out in the field on the open road, no IE connection while on the open road, who need access to a Help file in HTML) How do I do this ? Quote
forgottensoul Posted June 6, 2007 Posted June 6, 2007 Have you tried pr = pr.Start("IEXPLORE", "file://c:/mypage.html") That should work. Quote
lauriemc Posted June 6, 2007 Author Posted June 6, 2007 No, it didn't. This is the code I used: pr = pr.Start("IEXPLORE", "file://c:/TU_Help/index.html") and it came back with a message saying: Cannot find 'file:///c:/TU_Help/index.html'. Make sure the path or Internet Address is correct. What I noticed is that it put an extra slash in front of the c: I did check the address and it checks out okay.:( Quote
forgottensoul Posted June 7, 2007 Posted June 7, 2007 (edited) How odd... The following code works for me. [csharp] Process pr = new Process(); pr.StartInfo.FileName = "IEXPLORE"; pr.StartInfo.Arguments = "file://c:/mypage.html"; pr.Start(); [/csharp] Its in C#, but I would assume yours should work. One thing I do see in your code is that you are reassigning your pr to pr.start. Is that correct for VB? It doesn't look right. Edited June 7, 2007 by forgottensoul Quote
Eduardo Lorenzo Posted June 7, 2007 Posted June 7, 2007 this Dim pr As Process = New Process() pr.StartInfo.FileName = "IEXPLORE" pr.StartInfo.Arguments = "file://c:/mypage.html" pr.Start() would be the VB version. you can also try to use the shell command. Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & URL_OR_PATH , AppWinStyle.MaximizedFocus) I hope this helps. Quote
lauriemc Posted June 7, 2007 Author Posted June 7, 2007 Thanks everybody :) The last solution worked wonderful - ONCE I realized I had an .htm file instead of an .html file. I would have gone around in circles for days if I hadn't finally tried testing with a mypage... right on the C drive - and then realized my extension was wrong. But i learned some things and am happy about that, thanks again Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.