VBA for Outlook reminders

ArtemisApollo2021

New Member
Joined
Jul 8, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello, I’m trying to setup a VBA to setup a reminder on outlook for scheduling purposes. Column A contains the date and times with half hour intervals starting at 8am and ending 8pm. I want it to pick up information from other columns, but the data from column A to establish the date and interval. So, it would take the column C value to establish a reminder needs to be set and use coul
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I have this to create calendar date/time reminders as recurring events. If you don't get any more focused help, maybe you can adapt it. In the source sheet, col A contains names, col B the date time e.g. 2/18/1963 8:00:00 AM.
VBA Code:
Sub ImportBirthdaysToCalendar()
    Dim objWorksheet As Excel.Worksheet
    Dim nRow As Integer, nLastRow As Integer
    Dim objOutlookApp As Outlook.Application
    Dim objCalendar As Outlook.Folder
    Dim objBirthdayEvent As Outlook.AppointmentItem
    Dim objRecurrencePattern As Outlook.RecurrencePattern
 
    'Get the specific sheet
    Set objWorksheet = ThisWorkbook.Sheets(1)
    nLastRow = objWorksheet.Range("A" & objWorksheet.Rows.Count).End(xlUp).Row
 
    Set objOutlookApp = CreateObject("Outlook.Application")
    Set objCalendar = objOutlookApp.Session.GetDefaultFolder(olFolderCalendar)
 
    For nRow = 2 To nLastRow
        Set objBirthdayEvent = objCalendar.Items.Add("IPM.Appointment")
 
        'Create birthday events
        With objBirthdayEvent
            .Subject = objWorksheet.Range("A" & nRow) & Chr(39) & "s Birthday"
            .Body = "Born " & Format(Int(objWorksheet.Range("B" & nRow)), "mmmm dd, yyyy")
            .AllDayEvent = False
            .Start = objWorksheet.Range("B" & nRow)
            .BusyStatus = olFree
            .ReminderSet = True
            .ReminderMinutesBeforeStart = 4320
         Set objRecurrencePattern = .GetRecurrencePattern
         With objRecurrencePattern
            .RecurrenceType = olRecursYearly
            .PatternStartDate = objWorksheet.Range("B" & nRow)
            .NoEndDate = True
         End With
            .Save
        End With
    Next
End Sub
Properties & methods for Outlook appointment item can be found here if you need other ones.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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