ShellExecute

fitchic77
06-22-2001, 10:48 AM
I need help on ShellExecute. I am getting an error on compiling:

Private Sub TurnUp_Click()
Dim lngResult As Long
Dim strDocument As String

' Change the path below to something appropriate for you.
strDocument = "http://www.yahoo.com"

lngResult = ShellExecute(Me.hwnd, "Open", strDocument, "", "", vbNormalFocus)
End Sub

The error is: Method or Data Member not found

THANKS!
Andrea

fitchic77
06-22-2001, 11:01 AM
I got it working. Here is how:

DECLARE in Module:
Public 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 Command_Click()
Dim lngResult As Long
Dim strDocument As String
strDocument = "http://www.yahoo.com"

Call ShellExecute(0, "Open", strDocument, "", "", vbNormalFocus)
End Sub

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum