Click to See Complete Forum and Search --> : what is the code to open default mail browser?
Spawny
Jun 25th, 1999, 07:40 AM
Hi, I want be able to open the users default email browser so the user can send me comments. I also want to have it come off of a label that has the email address on it. i.e email@mail.com.
thanx in advance
atomsheep
Jun 25th, 1999, 11:53 AM
you can use the ShellExecute API function which is:
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
you will also need to declare the public constant:
public const SW_SHOWNORMAL = 1
to show the default mail program just call the API function:
t& = ShellExecute(0&, vbNullString, "somebody@somewhere.net", vbNullString, "C:\", SW_SHOWNORMAL")
Spawny
Jun 25th, 1999, 04:40 PM
Thanx for the info atomsheep but i have one question more since i am only a novice at VB. Just correct me if i am wrong, which is often true of VB, the declare stuff goes into General Decs of the form I am using? The public const goes into a module. But where does the t& go?
[This message has been edited by Spawny (edited 06-26-1999).]
CarlosTheJackal
Jun 26th, 1999, 11:10 AM
hey-there's a much easier way to do what you want....
Shell "Start mailto:whoever@wherever.com"
that doesnt require any special declarations.
thnx for your time,
CarlosTheJackal
Spawny
Jun 26th, 1999, 03:14 PM
Thanks CarlosTheJackal.. that was easier to use. Thanx to both you guys for your help.
take it easy.
Mike
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.