PDA

Click to See Complete Forum and Search --> : E-mail address


aksha
Mar 6th, 2001, 01:24 AM
I have added my e-mail address as a label in the 'about' form. With MouseMove method it changes color to indicate a clickable element. On click, I want it to connect to the default e-mail composer (e.g. Outlook Express) but don't know how! Can anyone help?

Achichincle
Mar 6th, 2001, 07:49 AM
This was in another thread and was originally posted by Stever2003:


Private Const SW_SHOWNORMAL = 1

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 Sub Command1_Click()
Dim strThing As String
strThing = Text1.Text
'strThing can be anything: a file, a webpage, or an email address
Dim Success As Long
Success = ShellExecute(0&, vbNullString, strThing, vbNullString, "C:\", SW_SHOWNORMAL)
End Sub


You basically shell to the default mail handler (or whatever is set to handle the type of file/address you enter in strThing)

aksha
Mar 8th, 2001, 09:45 AM
I managed to find the answer elsewhere. I thought I might as well share it with you all. This is what I was looking for.

Private Sub Label1_Click()
Response= ShellExecute(Me.hwnd, "open", "mailto:aksha@quest4india.com", "", "", 1)
End Sub

Thanks.

Achichincle
Mar 8th, 2001, 09:49 AM
Looks like the same thing no?