+ Reply to Thread
Results 1 to 1 of 1

Help! Automated Email coding for Excel 2016 and Outlook 2016 problems

  1. #1
    Registered User
    Join Date
    01-29-2010
    Location
    Dinas, Wales
    MS-Off Ver
    Excel 2003
    Posts
    1

    Help! Automated Email coding for Excel 2016 and Outlook 2016 problems

    I have tried to make this an automated email and keep getting errors. Can someone look at my code and tell me what I am doing wrong? Thank you in advance to anyone able to help me, I am a complete beginner!

    My code for the email:
    [INDENT]Sub SendReminderMail()
    Dim OutLookApp As Object
    Dim OutLookMailItem As Object
    Dim iCounter As Integer
    Dim MailDest As String

    Set OutLookApp = CreateObject("Outlook.application")
    Set OutLookMailItem = OutLookApp.CreateItem(0)

    With OutLookMailItem
    MailDest = ""
    For iCounter = 1 To WorksheetFunction.CountA(Columns(4))
    If MailDest = "" And Cells(iCounter, 4).Offset(0, -1) = "Send Reminder" Then
    MailDest = Cells(iCounter, 4).Value
    ElseIf MailDest <> "" And Cells(iCounter, 4).Offset(0, -1) = "Send Reminder" Then
    MailDest = MailDest & ";" & Cells(iCounter, 4).Value
    End If
    Next iCounter

    .to = "the email id to whom you want to send"
    .CC = "The email id to whom to put CC"
    .BCC = "The email id"
    .Subject = "FYI"
    .Body = "Renewal due, see Lisa."
    .Send
    End With

    Set OutLookMailItem = Nothing
    Set OutLookApp = Nothing

    End Sub


    My code for the automated button:

    Private Sub CommandButton1_Click()
    For Each cell In Range("D2:D100")
    If cell.Value < Date + 14 And cell.Value <> "" Then
    cell.Interior.ColorIndex = 3
    cell.Font.ColorIndex = 2
    cell.Font.Bold = True
    Application.Speech.Speak ("send reminder to")
    'cell.Value = cell.Offset(0,-2).Value
    Application.Speech.Speak (cell.Offset(0, -2).Value)
    End If

    ' Application.Speech.Speak ("cell.text")

    Next
    SendReminderMail
    End Sub

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    End Sub
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Send email from outlook 2016
    By kirana2014 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-30-2017, 01:29 PM
  2. Using VBA on Excel workbook to set up reminder via Outlook (Office 2016)
    By flupsie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-12-2017, 12:13 AM
  3. Copy /paste excel data with mouse over comments to outlook 2016.
    By Rakeshkrishnan01 in forum Excel General
    Replies: 3
    Last Post: 06-28-2017, 02:24 PM
  4. Replies: 20
    Last Post: 10-19-2016, 06:05 AM
  5. Problems / small issues in Excel 2016
    By MathiasV in forum Excel General
    Replies: 3
    Last Post: 09-02-2016, 08:03 AM
  6. Excel 2016 Trust Center problems
    By starcrwzr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2016, 06:22 PM
  7. Replies: 2
    Last Post: 05-24-2016, 10:43 PM

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