Results 1 to 3 of 3

Thread: sendemail does not work

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    2

    Post

    The "sendemail" feature that is used within most examples does not work on my machine. I receive an error message: Microsoft Outlook cannot create the item.

    Is there another way to put a "hot" label on a VB form?

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    Try this:
    Create a Label (Label1), set its Caption to an e-mail address, and let the code take care of everything else!
    Code:
    Option Explicit
    
    
    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 Form_Load()
        Label1.AutoSize = True
    End Sub
    
    
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Label1.ForeColor = vbButtonText
        Label1.Font.Underline = False
    End Sub
    
    
    Private Sub Label1_Click()
        Call ShellExecute(0, vbNullString, "mailto:" & Label1.Caption, vbNullString, vbNullString, vbNormalFocus)
    End Sub
    
    
    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Label1.ForeColor = vbBlue
        Label1.Font.Underline = True
    End Sub
    ------------------
    Yonatan
    Teenage Programmer
    E-Mail: [email protected]
    ICQ: 19552879



  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    2

    Post

    Thanks...turns out that I needed to reinstall Outlook!

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