VBA Code to check if a reminder already exists

April 2, 2019 at 12:48:36
Specs: Windows 7
I have some vba code that creates a reminder in my outlook calendar from data in excel. But I don't have a way of knowing if I already have created the reminder previously. I want to know if someone can help me tweak my code to show me if I already have this reminder set in outlook. The reminder will have the same exact text in the subject line.
So if the reminder is already there a message saying reminder already set
if not
then set the reminder like normal.

Here is my code:

Sub D_Reminders()
    Dim appOl As Object
    Dim objReminder As Object
    Set appOl = GetObject(, "Outlook.application")
    Set objReminder = appOl.CreateItem(1)
    objReminder.Start = ActiveSheet.Range("AC" & ActiveCell.Row).Value
    objReminder.Duration = 1
    objReminder.Subject = "Rate Expires for " & ActiveSheet.Range("A" & ActiveCell.Row).Value
    objReminder.ReminderSet = True
    objReminder.Location = "N/A"
    objReminder.busystatus = olfree
    objReminder.body = "Loan Expires " & ActiveSheet.Range("I" & ActiveCell.Row).Value
    objReminder.display
End Sub


See More: VBA Code to check if a reminder already exists

Reply ↓  Report •

#1
April 2, 2019 at 18:38:27
The code here creates a list of existing reminders. Maybe you could come up with some code that loops through the list looking for the text in the subject line.

https://www.datanumen.com/blogs/qui...

How To Post Data or Code ---> Click Here Before Posting Data or VBA Code


Reply ↓  Report •

#2
April 2, 2019 at 19:06:19
I saw this but ran into an error when trying to use. The debugger gives me a compile error user-defined typo not defined and stops at "Dim objReminders As Reminders".
any suggestions?

Reply ↓  Report •

#3
April 3, 2019 at 08:06:03
I'll have to look into this later tonight. I can not enable macros in Outlook on my corporate system.

message edited by DerbyDad03


Reply ↓  Report •

Related Solutions

#4
April 3, 2019 at 08:22:10
You're trying to use Outlook VBA from Excel VBA. Excel VBA doesn't know what a "Reminders" is. You need to either include a VBA reference to Outlook's VBA objects, or you need to Dim everything in that script that isn't a String as an Object. You'll also need to replace "olNoteItem" with "5".

How To Ask Questions The Smart Way


Reply ↓  Report •

#5
April 3, 2019 at 18:08:36
Thanks for the advise Razor2.3 but I am not a real programmer, I just try to find automation solutions for my day to day work. Any chance you can help me with the code?

Reply ↓  Report •

#6
April 4, 2019 at 10:08:47
Much like DerbyDad03, I don't have a scriptable version of Outlook available to me. Could I come up with something that looks like it'd work? Sure. Do I have any way to test it? No.

How To Ask Questions The Smart Way


Reply ↓  Report •

Ask Question