Was wondering if there is a method that works similarly to FromFile for MapiMessage but for the Outlook types of Appointments, the different types of Task items (taskRequest, taskRequestAccept, taskRequestDecline) and Read Reports. If not, is there a method that can be used to identify what type of email item it is from a filepath?
Hello @miguelsilva,
Pease try the following:
var msg = MapiMessage.Load("my.msg");
switch (msg.SupportedType)
{
// A contact item. Can be converted to MapiContact.
case MapiItemType.Contact:
var contact = (MapiContact)msg.ToMapiMessageItem();
break;
// A calendar item. Can be converted to MapiCalendar.
case MapiItemType.Calendar:
var calendar = (MapiCalendar)msg.ToMapiMessageItem();
break;
// A distribution list. Can be converted to MapiDistributionList.
case MapiItemType.DistList:
var dl = (MapiDistributionList)msg.ToMapiMessageItem();
break;
// A Journal entry. Can be converted to MapiJournal.
case MapiItemType.Journal:
var journal = (MapiJournal)msg.ToMapiMessageItem();
break;
// A StickyNote. Can be converted to MapiNote.
case MapiItemType.Note:
var note = (MapiNote)msg.ToMapiMessageItem();
break;
// A Task item. Can be converted to MapiTask.
case MapiItemType.Task:
var task = (MapiTask)msg.ToMapiMessageItem();
break;
}
Thanks.