Results 1 to 4 of 4

Send Email With PDF Attachment Macro to Multiple Recipients

Threaded View

  1. #1
    Registered User
    Join Date
    07-08-2017
    Location
    Minnesota
    MS-Off Ver
    Microsoft Office 2016
    Posts
    78

    Send Email With PDF Attachment Macro to Multiple Recipients

    Hello,

    In the attached workbook and below code, I am trying to accomplish sending an email to a bunch of different contacts with a pdf attachment.

    Can this code be changed so an email is sent to multiple recipients with an attachment for each contact? Or does someone know code that will send an email to multiple recipients with a different attachment for each? The pathways for attachments are:

    C:\Users\rhoover\Desktop\Caroline.pdf
    C:\Users\rhoover\Desktop\Dan.pdf
    C:\Users\rhoover\Desktop\Wendy.pdf
    C:\Users\rhoover\Desktop\Tina.pdf
    C:\Users\rhoover\Desktop\Ryan.pdf
    C:\Users\rhoover\Desktop\Pam.pdf
    C:\Users\rhoover\Desktop\Trent.pdf
    C:\Users\rhoover\Desktop\Dillon.pdf


    
    Sub Email_Rent_Edit()
    
        Dim OutApp As Object
        Dim OutMail As Object
        Dim cell As Range
        Dim strbody As String
        
        Application.ScreenUpdating = False
        Set OutApp = CreateObject("Outlook.Application")
    
        On Error GoTo cleanup
        For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
            If cell.Value Like "?*@?*.?*" And _
               LCase(Cells(cell.Row, "C").Value) = "yes" Then
                strbody = cell.Offset(0, 3) & vbNewLine
            
                Set OutMail = OutApp.CreateItem(0)
                On Error Resume Next
                With OutMail
                    .To = cell.Value
                    .Subject = "Rent Edit"
                    .Body = "Hi " & Cells(cell.Row, "A").Value & "," & vbNewLine & vbNewLine & strbody
                    .Attachments.Add "C:\Users\rhoover\Desktop\Caroline.pdf"
                    .Display 'use Send or Display
                    
                End With
                On Error GoTo 0
                strbody = ""
                Set OutMail = Nothing
            End If
        Next cell
    
    cleanup:
        Set OutApp = Nothing
        Application.ScreenUpdating = True
    End Sub
    Thank you for any help!!
    Last edited by Hoover5896; 04-03-2018 at 09:05 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Email as PDF attachment for multiple recipients
    By majime01 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-17-2016, 04:16 PM
  2. How to send an email to multiple recipients from outlook with PDF.
    By marc5354 in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 12-10-2015, 07:51 PM
  3. Help with Macro to email attachment to multiple recipients
    By markharris2004 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2014, 08:48 AM
  4. send email to multiple recipients
    By plans in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-18-2014, 09:26 AM
  5. Send workbook via email to multiple recipients
    By jdavies294 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-16-2014, 10:44 AM
  6. Macro to send email with multiple attachment
    By excelcheck123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2012, 05:00 PM
  7. Send email to multiple recipients
    By Court16 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-24-2009, 05:20 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1