Results 1 to 5 of 5

Thread: What is wrong???

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Dallas, Texas
    Posts
    52
    Private Sub opt5_Click()
    On Error GoTo EmailError
    Success = ShellExecute(0&, vbNullString, "mailto:[email protected]", vbNullString, "C:\", 1)
    Exit Sub
    EmailError:
    MsgBox "There was an unexpected error while trying to initialise your email facilities. This may be because your computer does not have email facilities, or it may be because of a faulty installation."

    End Sub

    When I try to use this, I get a compile error that highlights ShellExecute in the 3rd line.

    What do I need to do to get this to work?

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Have you delclared the shellexecute api?


    http://www.vb-world.net/demos/shelle...modvbworld.bas

    Mark
    -------------------

  3. #3
    Guest
    [/code]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[/code]

    Put this in a module.

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    email


    'launch default email program and send mail

    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 Const SW_SHOW = 5

    'form code
    ShellExecute hwnd, "open", "mailto:[email protected]", vbNullString, vbNullString, SW_SHOW
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Dallas, Texas
    Posts
    52

    OH MY GOD!!!!!

    HeSaidJoe,
    It worked!!!!! I finally figured out what you mean't and put it in. Yippee!!!!!!!!

    Thanks more than you know.....

    Jim

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