Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 ?

Posted

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.:(

Posted (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 by forgottensoul
Posted

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.

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...