PDA

Click to See Complete Forum and Search --> : Email


QWERTY
Nov 4th, 1999, 06:50 AM
I would like to put my E-mail address in About form of my program, and I don't know how to do it so when user clicks label with E-mail address on it it will automatically launch for example Microsoft Outlook (or any other "mailing" program)
Thanks

------------------
Visual Basic Programmer
-----------------
PolComSoft
You will hear a lot about it.

Compwiz
Nov 4th, 1999, 06:55 AM
In .bas module:

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:


Private Sub Label1_Click()
LaunchEmail "tom@e-bizinternet.com", Me
End Sub


Try that.

------------------
Tom Young, 14 Year Old
tom@e-bizinternet.com
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer

QWERTY
Nov 4th, 1999, 06:58 AM
Thanks

------------------
Visual Basic Programmer
-----------------
PolComSoft
You will hear a lot about it.