Hello,
I’m using Aspose.Email 21.5 with c# to extract events in PST files to Exchange mailboxes. I met a issue that the occurrence of events cannot be edited in Outlook. Besides, the event work well on web page, OWA side.
Sample codes to extract events to mailbox:
var client = EWSClient.GetEWSClient(“https://outlook.office365.com/ews/exchange.asmx”, credential, null);
var ps = PersonalStorage.FromFile(@"{pst path}");
var folders = ps.RootFolder.GetSubFolders();
var calendarFolder = folders.Find(f => f.DisplayName.Equals(“Calendar”, StringComparison.OrdinalIgnoreCase));
var items = calendarFolder.GetContents();
foreach (var i in items)
{
try
{
var message = ps.ExtractMessage(i);
var calendar = message.ToMapiMessageItem() as MapiCalendar;
calendar.Save($@“F:\{i.Subject}.msg”, Aspose.Email.Calendar.AppointmentSaveFormat.Msg);
var MMessage = MailMessage.Load($@“F:\{i.Subject}.msg”, new MsgLoadOptions() { PreserveTnefAttachments = true });
client.AppendMessage(“Calendar”, MMessage);
}
catch (Exception ex)
{ }
}
PS ,we need replace the recipients in events, so the message is converted to MAPI calendar first.
Sample PST file:
ray.zip (21.7 KB)
The event called weekly.
If you use Outlook to open an occurrence, you cannot modify title or description through there is a cursor in input field. The time cannot be input but the scroll is OK. And some fields are gray.
image.png (9.5 KB)
PS, My Outlook is
image.png (17.2 KB)
After some researching, I find the issue related to this property on master event:
PR_TRANSPORT_MESSAGE_HEADERS_W (0x007D001F)
If I remove the property on master event, the occurrence will work well in Outlook and it’s OK to modify the occurrences.
Could I remove this property from events? What’s the meaning of this property?
Thanks.