Results 1 to 5 of 5

Excel VBA Outlook Email Help!

Threaded View

  1. #1
    Registered User
    Join Date
    07-13-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    4

    Excel VBA Outlook Email Help!

    Hi all,

    I have tried various websites and methods but I appear to be a little out of my depth. I would like excel to if Column AB = Yes to send an email via Outlook to an email address listed in Column W and for the persons name to be included in the email (Column V) along with other Column cells too which meet the criteria of AB = Yes.

    The email I am hoping to create would be:

    Dear (Column V)

    Regarding (Column A) and (Column B)

    The above named member of staff has been absent since (Column F) and was last contacted on (Column AA). Please arrange to make contact with the member of staff as soon as possible and complete the attached form and return to XXXXXXX


    Your help with this would be appreciated, this is the code I have so far:

    Sub Email()
    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("W").Cells.SpecialCells(xlCellTypeConstants)
    If cell.Value Like "?*@?*.?*" And _
     LCase(Cells(cell.Row, "AB").Value) = "yes" Then
    
    Set OutMail = OutApp.CreateItem(0)
    On Error Resume Next
    With OutMail
     .To = cell.Value
     .Subject = "Contact Reminder"
     .Body = "Dear " & Cells(cell.Row, "W").Value _
     THIS IS WHERE I HAVE GOT STUCK!
    
     .Send
    End With
    On Error GoTo 0
    Set OutMail = Nothing
    End If
    Next cell
    
     cleanup:
    Set OutApp = Nothing
     Application.ScreenUpdating = True
    End Sub
    Thank you in advance!
    Last edited by lqv81s; 07-13-2015 at 05:43 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. vba pull data from outlook body of email through email or subject of mail into excel
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 04:37 AM
  2. Outlook Email via Excel
    By aijp in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-20-2013, 05:34 PM
  3. export outlook 2007 email into excel with subject and body of email
    By akulka58 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2013, 02:37 PM
  4. How to parse data in Outlook email using HTML version of email back to excel
    By bnasty in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 10-31-2012, 02:54 PM
  5. Replies: 2
    Last Post: 08-01-2012, 02:47 PM
  6. [SOLVED] Excel email: Outlook not recognizing email ID
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-16-2012, 10:03 AM
  7. Outlook Email via Excel
    By stevetothink in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 11-30-2010, 12:19 PM
  8. Email using Excel VBA and Keeping Outlook Signature on the Email
    By Shama in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2009, 07:39 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