Results 1 to 5 of 5

Thread: Auto E-mail For Due Date Reminder Using Outlook

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    18
    Rep Power
    0
    Hi,

    please insert a column after column D (OverDue days) and put the formula to updating the overdue days (=TODAY()-D2)

    Please find the code.

    Code:
    Option Explicit
    Sub email_outlook()
        Dim due_date As Date
        Dim row_cnt As Integer
        Dim outapp, outmail, Mail_body, job As String
        Dim source As Range
        Dim cell As Range
        Set outapp = CreateObject("Outlook.Application")
        Set outmail = outapp.CreateItem(0)
        due_date = Format(Now(), "DD-Mmm-YY")
        Cells(1, 1).AutoFilter Field:=5, Operator:=xlFilterValues, Criteria1:="<=0" 'Array(0, "<=0")
        row_cnt = Cells(1).End(xlDown).Row 'ActiveSheet.UsedRange.Rows.Count
        Mail_body = "Please take notice of the following expiration date(s):"
        Set source = Range("A2:A" & row_cnt).SpecialCells(xlCellTypeVisible)
        For Each cell In source
            job = "Equipment Job " & cell.Value & " expiration date : " & cell.Offset(0, 3).Value & " - " & Abs(cell.Offset(0, 4).Value) & " Overdue days."
            Mail_body = Mail_body & vbNewLine & job
        Next cell
        Mail_body = Mail_body & vbNewLine & "Send at " & Now()
    
        With outmail
            .to = "test"
            .CC = ""
            .BCC = ""
            .Subject = "This is the Subject line"
            .Body = Mail_body
            .Send
        End With
    End Sub

  2. #2
    Junior Member
    Join Date
    Sep 2013
    Posts
    3
    Rep Power
    0
    I think my query was mis-understood. My problem is not related to calculating the overdue days. Its very well calculated. My problem is - rather than sending separate emails for each item, wanted one single consolidated mail.

Similar Threads

  1. Replies: 2
    Last Post: 07-02-2013, 02:36 PM
  2. Replies: 5
    Last Post: 06-11-2013, 08:15 PM
  3. Automatically send Birthday E-Mail in Outlook
    By s.ajay88 in forum Outlook Help
    Replies: 2
    Last Post: 03-12-2013, 06:28 PM
  4. Replies: 4
    Last Post: 03-01-2013, 10:48 PM
  5. Outlook Send Mail With Multiple Recipient and CC
    By noobtron in forum Excel Help
    Replies: 2
    Last Post: 10-31-2012, 07:14 PM

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
  •