Results 1 to 2 of 2

Thread: Email

  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Question Unanswered: Email

    Hello everyone I am trying to put some code in a command button to email whoever I choose in snapshot view. Keep getting this error message I'm still new to vb so please bare with me..Thanks

    Code:
    Private Sub Command165_Click()
    On Error GoTo Err_Command165_Click
    
       Dim appOutlook As New Outlook.Application
        Dim omItem As MailItem
        Dim ReqId As String
        
        ReqId = Me.txt1.Value
        Set omItem = appOutlook.CreateItem(olMailItem)
        
        omItem.To = "email_address"
        omItem.DeleteAfterSubmit = True
        omItem.Subject = "Your subject"
        omItem.Body = "Your email body"
        omItem.Send
    
    Exit_Command165_Click:
        Exit Sub
    
    Err_Command165_Click:
        MsgBox Err.Description
        Resume Exit_Command165_Click
        
    End Sub
    Last edited by desireemm; 04-15-09 at 17:23.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    See the comment about early binding. You need to use Tools | References to make it available.

    -PatP

Posting Permissions

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