When writing automation for certain processes, it is sometimes important to set a follow-up reminder appointment for the next step. For this task, I wrote a very simple script that sets a reminder in Outlook.
This script is super simple and can be improved several different ways. For simplicity sake, I decided to leave out the fancy “With” procedure and just use the object reference. Also, to provide feedback to your app, this function evaluates to “true” once your reminder has been set.
'Before using this function, you must add a reference 'to your version of the Microsoft Outlook Object 'Library or you will encounter errors. '''''''''''''''''''''''''''''''''''' Function makeReminder(rDate As Date) As Boolean Dim ol As Outlook.Application, item As AppointmentItem Set ol = New Outlook.Application Set item = ol.CreateItem(olAppointmentItem) 'Set the reminder for 8:30 am on input date item.Start = rDate + TimeValue("8:30") 'Set one hour duration item.Duration = 60 'appointment subject item.Subject = "Write your fancy subject line here" 'location description item.Location = "Somewhere over there" 'body message item.Body = "What in the world are you doing at this time?" 'set the busy status item.BusyStatus = olBusy 'reminder before start item.ReminderMinutesBeforeStart = 15 'reminder activated item.ReminderSet = True 'duh! save the thing! item.Save 'garbage collection - kind of... Set ol = Nothing Set item = Nothing 'return true makeReminder = True End Function
Test Outlook Appointment VBA Script
To test this script, here is an example:
Sub testThing() Dim rDate As Date 'set date rDate = InputBox("start") If makeReminder(rDate) = True Then MsgBox "Reminder Set" Else MsgBox "Oy! Something is a miss" End If End Sub
So there it is! My obviously simple Outlook Appointment setting function. That being said, this demo was created to be a simple framework for what the object can do. If you use this, please post a comment about how you used it and any extra features you used.