Meeting reminders smiplified

iwilli

New Member
Joined
Jan 31, 2012
Messages
43
I have a spreadsheet with client names, email addresses, and appointment info. I export a .csv file from outlook. I have been doing a mail merge in word and then coping and pasting into an Outlook message and sending it out. I did some reseach and found code that I have made changes to. Of course they it doesn't work. I can't get anything to happen when I run this code. As always what am I doing worng?
Code:
Sub Qualls_Email_Confirms()


    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 = "Your Appointment with Marcus Qualls " & Cells(cell.Row, "W").Value
                .Body = strbody
                .Body = "Dear " & Cells(cell.Row, "A").Value _
                      & vbNewLine & vbNewLine & _
                        "Just a note to confirm our appointment" & vbNewLine & _
                        "Date: " & Cells(cell.Row, "H").Value & vbNewLine & _
                        "Time: " & Cells(cell.Row, "I").Value & vbNewLine & _
                        "Place: " & Cells(cell.Row, "W").Value & vbNewLine & vbNewLine & _
                        "Please reply back to this email to confirm you will be able to keep this appointment."

                'You can add files also like this
                '.Attachments.Add ("C:\test.txt")
                .Display  'Or use Send
            End With
            On Error GoTo 0
            Set OutMail = Nothing
        End If
    Next cell

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

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I can't get anything to happen when I run this code. As always what am I doing worng?
Well, for one thing, you haven't told us what it doesn't do.

Have you stepped through the code in the editor to see what results it produces?
 
Upvote 0
I tried it and it went through fine got this in an e-mail
Dear <o:p></o:p>
Just a note to confirm ourappointment
Date:
Time:
Place: <o:p></o:p>
Please reply back to thisemail to confirm you will be able to keep this appointment.

All I done was put my email address in column B and the word yes in Column C next to it and ran the macro. Nothing else.
<o:p></o:p>
 
Upvote 0
Thanks guys I figured out my problem was that I formulas and not values in the cells. Tinbendr it creates an email with appointment info.
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top