 |
ranosb Level: Protégé
 Registered: 10-04-2008 Posts: 6
|
Shell command
Cant seem to be able to open a file using the shell command in VB6!
Why is this not working?
Shell App.Path + "\linkgrabber.htm", vbNormalFocus
I dont know why when I post this the backslash does not appear before the linkgrabber.htm file??
[Edited by ranosb on 15-04-2008 at 10:29 AM GMT]
Use double backslash to have one...strange I should check this thing...
[Edited by admin on 15-04-2008 at 04:30 PM GMT]
|
|
15-04-2008 at 10:17 AM |
|
|
Keithuk Level: Graduate

 Registered: 02-11-2006 Posts: 12
|
Re: Shell command
quote: ranosb wrote:
Cant seem to be able to open a file using the shell command in VB6!
Why is this not working?
Shell App.Path + "linkgrabber.htm", vbNormalFocus
I dont know why when I post this the backslash does not appear before the linkgrabber.htm file??
Shell won't open any file apart from *.bat, *.exe or *.com. To open your html link you need to use the ShellExecute API.
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
Private Const SW_SHOW = 5
Private Sub Command1_Click()
ShellExecute Me.hwnd, "open", App.Path & "linkgrabber.htm", vbNullString, vbNullString, SW_SHOW
End Sub
|
This will use your default webbrowser to open the file.
What a crap editor I can't put the slash in App.Path & "linkgrabber.htm"
[Edited by Keithuk on 09-05-2008 at 12:12 PM GMT]
____________________________
I've been programming with VB for 14 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
|
|
09-05-2008 at 12:07 PM |
|
|
|
|
 |
 |