Results 1 to 5 of 5

Thread: what is the code to open default mail browser?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    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 protected].

    thanx in advance

  2. #2
    Junior Member
    Join Date
    Apr 1999
    Location
    Sydney, NSW, Australia
    Posts
    22

    Post

    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, "[email protected]", vbNullString, "C:\", SW_SHOWNORMAL")

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    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).]

  4. #4
    Member
    Join Date
    Feb 1999
    Location
    ,Mo,USA
    Posts
    36

    Post

    hey-there's a much easier way to do what you want....

    Shell "Start mailto:[email protected]"

    that doesnt require any special declarations.

    thnx for your time,
    CarlosTheJackal

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    Thanks CarlosTheJackal.. that was easier to use. Thanx to both you guys for your help.
    take it easy.
    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width