In .bas module:
Code:
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
Dim success As Integer
Function ShellToBrowser%(Frm As Form, ByVal URL$, ByVal WindowStyle%)
Dim api%
api% = ShellExecute(Frm.hwnd, "open", URL$, "", App.Path, WindowStyle%)
'Check return value
If api% < 31 Then
'error code - see api help for more info
MsgBox App.Title & " had a problem running your web browser." & _
"You should check that your browser is correctly installed." & _
"(Error" & Format$(api%) & ")", 48, "Browser Unavailable"
ShellToBrowser% = False
ElseIf api% = 32 Then
'no file association
MsgBox App.Title & " could not find a file association for " & _
URL$ & " on your system. You should check that your browser" & _
"is correctly installed and associated with this type of file.", 48, "Browser Unavailable"
ShellToBrowser% = False
Else
'It worked!
ShellToBrowser% = True
End If
End Function
Public Sub LaunchEmail(EMail As String, frm As Form)
success% = ShellToBrowser(frm, "mailto:" & EMail, 0)
End Sub
And then in the form code:
Try that.
------------------
Tom Young, 14 Year Old
[email protected]
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer