Help with outlook

rcirone

Active Member
Joined
Mar 12, 2009
Messages
483
Office Version
  1. 365
Platform
  1. Windows
Does anyone know of a way to add a template of events to an outlook calendar? we are going to track important dates for an email campaign and instead of making them up each time I would looking for a faster way to add them to a calendar as a bulk item of events on specific dates depending on the start date.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Not sure what that all means. I have a wb with code that loops over column A to get calendar events titles and col B to get the date/time of the event. The code also sets the recurrence pattern (for me it is yearly). If that seems like what you're asking for I can post it.
 
Upvote 0
Not sure what that all means. I have a wb with code that loops over column A to get calendar events titles and col B to get the date/time of the event. The code also sets the recurrence pattern (for me it is yearly). If that seems like what you're asking for I can post it.
Yes please
 
Upvote 0
These events just happen to be recurring birthday reminders. Note: they are Outlook AppointmentItems if that matters.
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
I changed the names to make them anonymous. The data is arranged like so (Column C is just a helper column to sort them for me by month/day). The time portion in the date isn't the time they were born, it is the time that Outlook fires the reminder. 4320 is the number of minutes for the reminder, so 3 days.
NAMEBIRTHDAYsort
DAISY DUCK
1/01/1965 8:00:00 AM​
01.01
DAFFY DUCK
1/14/1978 8:00:00 AM​
01.14
DONALD DUCK
1/23/1969 8:00:00 AM​
01.23
 
Upvote 0

Forum statistics

Threads
1,223,939
Messages
6,175,531
Members
452,651
Latest member
wordsearch

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