Class MapiCalendarYearlyAndMonthlyRecurrencePattern

MapiCalendarYearlyAndMonthlyRecurrencePattern class

Represents the base class for yearly and monthly recurrence patterns in MAPI calendar items. This abstract class provides common properties and functionality for patterns that can recur either monthly (on a specific day) or yearly (on a specific day of a specific month).

public class MapiCalendarYearlyAndMonthlyRecurrencePattern : MapiCalendarRecurrencePattern

Constructors

NameDescription
MapiCalendarYearlyAndMonthlyRecurrencePattern()Initializes a new instance of the MapiCalendarYearlyAndMonthlyRecurrencePattern class

Properties

NameDescription
CalendarType { get; set; }Gets or sets the type of calendar that is used
Day { get; set; }Gets or sets day of the month on which the recurrence falls.
DayOfWeek { get; set; }Gets or sets the days of week at which the event occurs
DeletedInstanceDates { get; }An array of dates, each of which is the original instance date of either a deleted instance or a modified instance for this recurrence.
EndDate { get; set; }Gets or sets Defines the end date of an item recurrence pattern.
EndType { get; set; }Gets or sets the ending type for the recurrence.
Exceptions { get; }An exception specifies changes to an instance of a recurring series.
override Frequency { get; }Gets or sets the frequency of the recurring series.
ModifiedInstanceDates { get; }An array of dates, each of which is the date of a modified instance.
OccurrenceCount { get; set; }Gets or sets the number of occurrences in a recurrence.
PatternType { get; set; }Gets or sets the type of recurrence pattern
override Period { get; set; }Gets or sets interval (in months) at which the meeting pattern repeats
Position { get; set; }Gets or sets the occurrence of the recurrence’s days in each month in which the recurrence falls.
SlidingFlag { get; set; }Defines whether pattern is sliding or not.
StartDate { get; set; }Gets or sets the start date of an item recurrence pattern.
WeekStartDay { get; set; }Gets or sets the first day of the calendar week.

Remarks

This class is designed to be inherited by concrete pattern implementations such as MapiCalendarMonthlyRecurrencePattern and !:MapiCalendarYearlyRecurrencePattern. Do not instantiate this class directly. Use the concrete pattern classes to define specific recurrence behaviors. The Period property determines whether the pattern is monthly or yearly based on whether it’s divisible by 12. The Day property specifies the day of the month, and DayOfWeek with Position define weekly occurrences within a month.

Examples

The following example shows how to create a yearly recurrence pattern for a MAPI calendar item.

[C#]

// Create a MapiCalendar
var calendar = new MapiCalendar(
    "Team Meeting",
    DateTime.Now,
    DateTime.Now.AddHours(2),
    " organizer@company.com",
    "attendee@company.com");

// Create a yearly recurrence pattern (repeats every year on January 15th)
var yearlyPattern = new MapiCalendarYearlyAndMonthlyRecurrencePattern()
{
    Period = 12,  // 12 months = 1 year
    Day = 15,     // 15th day of the month
    StartDate = DateTime.Now,
    EndDate = DateTime.Now.AddYears(5),
    Frequency = MapiCalendarRecurrenceFrequency.Yearly,
    PatternType = MapiCalendarRecurrencePatternType.Month,
    CalendarType = MapiCalendarRecurrenceCalendarType.CAL_GREGORIAN_US
};

// Set the recurrence pattern
calendar.Recurrence = new MapiCalendarEventRecurrence()
{
    RecurrencePattern = yearlyPattern
};

// Save the calendar item
calendar.Save("yearly_meeting.msg", SaveOptions.DefaultMsgUnicode);

[Visual Basic]

' Create a MapiCalendar
Dim calendar As New MapiCalendar(
    "Team Meeting",
    DateTime.Now,
    DateTime.Now.AddHours(2),
    "organizer@company.com",
    "attendee@company.com")

' Create a yearly recurrence pattern (repeats every year on January 15th)
Dim yearlyPattern As New MapiCalendarYearlyAndMonthlyRecurrencePattern() With {
    .Period = 12,  ' 12 months = 1 year
    .Day = 15,     ' 15th day of the month
    .StartDate = DateTime.Now,
    .EndDate = DateTime.Now.AddYears(5),
    .Frequency = MapiCalendarRecurrenceFrequency.Yearly,
    .PatternType = MapiCalendarRecurrencePatternType.Month,
    .CalendarType = MapiCalendarRecurrenceCalendarType.CAL_GREGORIAN_US
}

' Set the recurrence pattern
calendar.Recurrence = New MapiCalendarEventRecurrence() With {
    .RecurrencePattern = yearlyPattern
}

' Save the calendar item
calendar.Save("yearly_meeting.msg", SaveOptions.DefaultMsgUnicode)

See Also