|
-
Mar 16th, 2002, 07:26 PM
#1
Thread Starter
New Member
Problem with Shell
Ok, call me stupid, but I can't for the life of me figure out why this wont work...
Private Sub mPopHelp_Click()
Shell "IExplore " & App.Path & "\help\index.htm", vbMaximizedFocus
End Sub
Any help would be greatly appreciated
-
Mar 16th, 2002, 08:39 PM
#2
What happens when you try it? What is value in 'App.Path'?
Odds are it isn't working either because IExplore.exe or App.Path + "\help\index.htm" cannot be found.
-
Mar 16th, 2002, 08:52 PM
#3
Member
Call ShellExecute(0&, vbNullString, App.Path + "\help\index.htm", vbNullString, vbNullString, vbMaximizedFocus)
try that
-
Mar 16th, 2002, 08:52 PM
#4
Member
and this
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
a long way around but it works
-
Mar 16th, 2002, 09:21 PM
#5
Thread Starter
New Member
Its telling me that the file isn't found when I run the code. I know its there and I know I've got the correct path. The value of App.Path is "C:\Windows\Desktop\VB Projects\Lead Tools". I'd use ShellExecute, but that opens the file in the default viewer if I'm not mistaken. I need it to open in Internet Explorer regardless of what the default browser is.
-
Mar 16th, 2002, 10:10 PM
#6
The picture isn't missing
Shell can only be used to open .EXE files.
i don't know how to force a program to open a file.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Mar 16th, 2002, 10:22 PM
#7
Try using the short pathname to the file. The spaces in the long pathname might be causing your problem.
-
Mar 16th, 2002, 10:43 PM
#8
Thread Starter
New Member
Its not the long path name, I tried that and it still did the same thing. I did find a way to make it work though. This way works just fine...
Shell("C:\Program Files\Internet Explorer\IExplore.exe " & App.Path & "\help\index.htm", vbMaximizedFocus)
But this doesn't...
Shell "IExplore " & App.Path & "\help\index.htm", vbMaximizedFocus
Can someone tell me why ? If I go to Run and type in the latter of the two it works fine too. I know that shell works by using "notepad" instead of the full path, and also various others. I'm just confused as to why it wont work with IExplore. I was hoping to not have to specify the path of Internet Explorer in case for some strange Internet Explorer isn't located where it should be. I really dont know if that is a valid fear or not. Does anyone know what the chances of that happening are ? If its not worth worrying about then I'll just leave it, if it's something you think I should fix then I'll make the program get the location out of the registry. Anyway, thanks for your help...
-
Mar 17th, 2002, 01:32 AM
#9
Member
maybe cos Iexplore is not in the windows directory?
there will be a peice of code somewhere that tell you the path of iexplor on the pc the program is on.
its somthing like %windir%
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|