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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,215,601
Messages
6,125,758
Members
449,259
Latest member
rehanahmadawan

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