Reminder

G

Guest

Hello all,

How do I via vba write code that will automatically put in a reminder two
days out when an email is sent out from excel?

Example. I have an excel sheet that checks for corrections of a form, once I
have made the corrections via excel userform, I have a commandbutton (email)
that opens an outlook message, pastes my comments, inserts email addresses
etc. What I would also like to do is write code that creates a reminder in
outlook that will remind me to email after a couple of days.

Here is the code that I use to send the message from excel:
Dim OutApp As Object
Dim OutMail As Object

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)

With OutMail

.to = "(e-mail address removed)"
.CC = " "
.BCC = " "
.Subject = "OER for " & Worksheets("Correction_Sheet").Range("b3") &
", Thru date " & Worksheets("Correction_Sheet").Range("e5") & "."
.Body = Focus
.Display
Application.Wait (Now + TimeValue("0:00:04"))
Application.SendKeys "%esf{enter}"

End With

Set OutMail = OutApp.CreateItem(0)
Set OutApp = Nothing

Please help.
 
G

Guest

Add another function to create a separate Task Item with a reminder set:

Sub AddTaskWithReminder()
Dim OutApp As Outlook.Application
Dim objTask As Outlook.TaskItem

Set OutApp = CreateObject("Outlook.application")
Set objTask = OutApp.CreateItem(olTaskItem)
objTask.Subject = "Send E-mail"
objTask.ReminderSet = True
objTask.ReminderTime = DateAdd("d", 5, Date)
objTask.Display

Set OutApp = Nothing
Set objTask = Nothing
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top