Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Field

Status
Not open for further replies.

sspainhour

IS-IT--Management
Jan 8, 2002
9
US
Does anyone know how to make a text field an emailto: field. I have a field I store email addresses in. My boss would like to be able to click on the email address to send an email. I would appreciate any help. I am using VB 6.0. Thanks.
 
you would have to put code behind the click event of your text field.

To open an email you can do this:

Put this at the module level:
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

Then, put this behind your textfields's click event:

Dim OpenString As String

OpenString = "mailto:me@email.com"

ShellExecute frmHwnd, "Open", OpenString, vbNullString, vbNullString, 1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top