Outlook - Auto Create Appointment based on Email using VBA
I'm looking to try and have outlook automatically create an appointment
based on the Subject line of an incoming email. For instance if I receive
an email with the subject line "Demo Downloaded" I want it to create an
appointment for this email that shows the body of the message as the
"Note" on the Appointment. Also, I want the appointment TIME to be 2 hours
after the date of the email was sent to me. So if I received the email at
1pm eastern i want the appointment to be automatically set for 3pm
eastern.
I know I need to use VBA and have outlook run a script, which I know how
to do all of this. However all I currently know right now is how to
manually create an appointment based off the selected email, not the email
that has been received. Plus I dont know how to have it automatically set
the time or anything fancy like that...
This is currently all I have...
Sub CreateTask(Item As Outlook.MailItem)
Dim objTask As Outlook.TaskItem
Set objTask = Application.CreateItem(olTaskItem)
With objTask
.Subject = Item.Subject
.StartDate = Item.ReceivedTime
.Body = Item.Body
.Save
End With
Set objTask = Nothing
End Sub
No comments:
Post a Comment