+ Reply to Thread
Results 1 to 5 of 5

Send email to address (in cell)l and individual pdf files (in cell)

  1. #1
    Registered User
    Join Date
    11-28-2011
    Location
    Cambridge England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Send email to address (in cell)l and individual pdf files (in cell)

    Hi,

    I have a load of pdf files to send to students. Each one has their own file and I would like to have a macro that will send the files to their individual email address'. I have a sheet with the file names and the corresponding email address. I will use excel and outlook 2010 for this.

    Any help would be much appreciated.

    Many Thanks

    Oly

  2. #2
    Registered User
    Join Date
    11-28-2011
    Location
    Cambridge England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Send email to address (in cell)l and individual pdf files (in cell)

    sorry - here is the file
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-28-2012
    Location
    Poland
    MS-Off Ver
    Excel 2007/2010
    Posts
    94

    Re: Send email to address (in cell)l and individual pdf files (in cell)

    hi,
    maybe this'll be usefull
    HTML Code: 

  4. #4
    Registered User
    Join Date
    11-28-2011
    Location
    Cambridge England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Send email to address (in cell)l and individual pdf files (in cell)

    Thanks for the quick reply. 2 more questions you may be able to answer:

    1) How do I add outlook to the library
    2) This doesn't seem to add an attachment or am I being dim

    Cheers

  5. #5
    Registered User
    Join Date
    11-28-2011
    Location
    Cambridge England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Send email to address (in cell)l and individual pdf files (in cell)

    This works:

    Sub SendEmail()
    Dim OutApp As Object
    Dim OutMail As Object
    Dim cell As Range

    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

    Set OutMail = OutApp.CreateItem(0)
    On Error Resume Next
    With OutMail
    .To = cell.Value
    .Subject = "Reminder"
    .Body = "Dear " & Cells(cell.Row, "e").Value _
    & vbNewLine & vbNewLine & _
    "Please contact us to discuss bringing " & _
    "your account up to date"
    'You can add files also like this
    .Attachments.Add (Cells(cell.Row, "D").Value)
    .Send 'Or use Display
    End With
    On Error GoTo 0
    Set OutMail = Nothing
    End If
    Next cell

    cleanup:
    Set OutApp = Nothing
    Application.ScreenUpdating = True
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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