MapiCalendar.Load

Load(string)

Loads a MapiCalendar from the specified file.

public static MapiCalendar Load(string filePath)
ParameterTypeDescription
filePathStringThe path to the file to be loaded.

Return Value

Returns a MapiCalendar instance loaded from the specified file.

Exceptions

exceptioncondition
ArgumentExceptionfilePath is null or empty.
FileNotFoundExceptionThe specified file does not exist.
InvalidOperationExceptionThe file holds neither a calendar item nor an iCalendar.

Remarks

Accepts both formats Save can produce: an Outlook MSG file holding a calendar item, and an iCalendar file (read as FromIcs would, with encoding detection). This makes MapiCalendar.Load(path) the inverse of calendar.Save(path), which writes iCalendar by default.

See Also


Load(Stream)

Loads a MapiCalendar from the specified stream.

public static MapiCalendar Load(Stream stream)
ParameterTypeDescription
streamStreamThe stream to be loaded.

Return Value

Returns a MapiCalendar instance loaded from the specified stream.

Exceptions

exceptioncondition
ArgumentNullExceptionstream is null.
NotSupportedExceptionstream does not support reading.
InvalidOperationExceptionThe stream holds neither a calendar item nor an iCalendar.

Remarks

Accepts both formats Save can produce: an Outlook MSG file holding a calendar item, and an iCalendar file (read as FromIcs would, with encoding detection). This makes MapiCalendar.Load(path) the inverse of calendar.Save(path), which writes iCalendar by default.

The stream is read from its beginning, whatever its current position.

See Also