MapiAppointment Class

An appointment or a meeting (IPM.Appointment).

public class MapiAppointment : MapiMessage

Example

using var file = PstFile.Open(path);
var appointment = file.GetFolder("Calendar")!.EnumerateItems().OfType<MapiAppointment>().Single();
Assert.Equal("Test appointment", appointment.Subject);
Assert.Equal(new DateTime(2016, 8, 2, 15, 0, 0, DateTimeKind.Utc), appointment.Start);

// The recurrence: every Tuesday, with deleted and moved occurrences
var recurrence = appointment.GetRecurrence()!;
Assert.Equal(MapiRecurrenceFrequency.Weekly, recurrence.Frequency);
Assert.Equal(MapiDaysOfWeek.Tuesday, recurrence.DaysOfWeek);
Assert.HasCount(3, recurrence.DeletedInstanceDates);
Assert.HasCount(2, recurrence.Exceptions);
Assert.Equal(new DateTime(2016, 8, 23, 9, 0, 0), recurrence.Exceptions[0].StartDateTime);

// The RTF body, decompressed from the compressed RTF property
var rtf = Encoding.ASCII.GetString(appointment.GetRtfBody()!);
Assert.StartsWith(@"{\rtf1", rtf, StringComparison.Ordinal);
Inheritance
MapiMessage MapiAppointment

Properties

NameDescription
AllAttendeesGets the display names of all the attendees, separated by semicolons.
BusyStatusGets how the appointment shows the time of the user.
DurationGets the duration of the appointment.
EndGets the date and time, in UTC, when the appointment (or the first occurrence of a recurring appointment) ends.
IsAllDayGets whether the appointment is an all-day event.
IsMeetingGets whether the appointment is a meeting, which has attendees.
IsRecurringGets whether the appointment is recurring.
LocationGets the location.
OptionalAttendeesGets the display names of the optional attendees, separated by semicolons.
RecurrenceDescriptionGets the description of the recurrence, such as "every Monday from 9:00 to 10:00".
ReminderDeltaGets how long before the start the reminder fires.
ReminderSetGets whether a reminder is set.
RequiredAttendeesGets the display names of the required attendees, separated by semicolons.
SequenceGets the sequence number of the meeting, incremented by the organizer when the meeting changes.
StartGets the date and time, in UTC, when the appointment (or the first occurrence of a recurring appointment) starts.
TimeZoneDescriptionGets the description of the time zone of the appointment.
UidGets the unique identifier of the meeting, the UID of iCalendar: the identifier given by another application, or the hexadecimal global object identifier Outlook creates ([MS-OXCICAL] 2.1.3.1.1.20.26).

AllAttendees

MapiAppointment.cs

Gets the display names of all the attendees, separated by semicolons.

public string? AllAttendees { get; }

Property value

string?

Gets how the appointment shows the time of the user.

public MapiBusyStatus BusyStatus { get; }

Property value

MapiBusyStatus

Gets the duration of the appointment.

public TimeSpan? Duration { get; }

Property value

TimeSpan?

Gets the date and time, in UTC, when the appointment (or the first occurrence of a recurring appointment) ends.

public DateTime? End { get; }

Property value

DateTime?

Gets whether the appointment is an all-day event.

public bool IsAllDay { get; }

Property value

bool

Gets whether the appointment is a meeting, which has attendees.

public bool IsMeeting { get; }

Property value

bool

Gets whether the appointment is recurring.

public bool IsRecurring { get; }

Property value

bool

Gets the location.

public string? Location { get; }

Property value

string?

OptionalAttendees

MapiAppointment.cs

Gets the display names of the optional attendees, separated by semicolons.

public string? OptionalAttendees { get; }

Property value

string?

RecurrenceDescription

MapiAppointment.cs

Gets the description of the recurrence, such as "every Monday from 9:00 to 10:00".

public string? RecurrenceDescription { get; }

Property value

string?

ReminderDelta

MapiAppointment.cs

Gets how long before the start the reminder fires.

public TimeSpan? ReminderDelta { get; }

Property value

TimeSpan?

Gets whether a reminder is set.

public bool ReminderSet { get; }

Property value

bool

RequiredAttendees

MapiAppointment.cs

Gets the display names of the required attendees, separated by semicolons.

public string? RequiredAttendees { get; }

Property value

string?

Gets the sequence number of the meeting, incremented by the organizer when the meeting changes.

public int? Sequence { get; }

Property value

int?

Gets the date and time, in UTC, when the appointment (or the first occurrence of a recurring appointment) starts.

public DateTime? Start { get; }

Property value

DateTime?

TimeZoneDescription

MapiAppointment.cs

Gets the description of the time zone of the appointment.

public string? TimeZoneDescription { get; }

Property value

string?

Gets the unique identifier of the meeting, the UID of iCalendar: the identifier given by another application, or the hexadecimal global object identifier Outlook creates ([MS-OXCICAL] 2.1.3.1.1.20.26).

public string? Uid { get; }

Property value

string?

Methods

NameDescription
GetRecurrence()Returns the recurrence of the appointment.

GetRecurrence()

MapiAppointment.cs

Returns the recurrence of the appointment.

public MapiRecurrencePattern? GetRecurrence()

Returns

MapiRecurrencePattern? The recurrence, or null when the appointment is not recurring.

Exceptions

InvalidEmailDataException
The recurrence is malformed.