borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Menu Item Click)Next Topic (Visual basic for school, will reward) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Shell command
Poster Message
ranosb
Level: Protégé

Registered: 10-04-2008
Posts: 6

icon 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
View Profile Send Email to User Show All Posts | Quote Reply
Keithuk
Level: Graduate


Registered: 02-11-2006
Posts: 12
icon 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
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : Shell command
Previous Topic (Menu Item Click)Next Topic (Visual basic for school, will reward) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder