Consulting

Results 1 to 2 of 2

Thread: Sending Outlook Email to ReplyRecipients

  1. #1
    VBAX Regular
    Joined
    May 2014
    Posts
    46
    Location

    Sending Outlook Email to ReplyRecipients

    Hello,

    I am trying to send a email with an attachment, and set the ReplyTo address.

    I am getting :

    Runtime Error '287'
    Application-defined or Object-defined error

    On the line : .ReplyRecipients.Add "test@test.com"

    '***************************************
    ' *** CLICK EVENT BUTTON - Email NG ***
    '***************************************
    
    
    Private Sub btn_NGProvider_email_Click()
    
    
    GetUserFullName2
    
    
    ' *** SETUP OUTLOOK ***
    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Set OutApp = New Outlook.Application
    Set OutMail = OutApp.CreateItem(olMailItem)
    
    
    ' *** SETUP OTHER STUFF  ***
    ...
    
    
    ' *** CREATE PDF ***
    ...
    
    
    ...
    
    
    
    
    ' *** CREATE EMAIL ***
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    
    
    With OutMail
        .Subject = "Referral - " & Me.Event
        .Body = "FEEDBACK: "
        If EmailAddress > 0 Then
            .To = EmailAddress
        End If
        .Importance = olImportanceHigh
        .Attachments.Add FileName
        .ReplyRecipients.Add "test@test.com"
        .Display
    End With
    
    
    ' *** TIDY UP ***
    Set OutMail = Nothing
    Set OutApp = Nothing
    
    
    End Sub
    What am I doing wrong?

    Cheers

    -Al

  2. #2
    VBAX Regular
    Joined
    May 2014
    Posts
    46
    Location
    Update: I have since found out that my code works on my personal computer - I think it might be something to do with a G.Policy @ work.

Tags for this Thread

Posting Permissions

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