Hello,
I met a issue when using the latest Aspose.Email to read a task item in a PST file. The code is built in C#.
Sample code:
var pstStore = PersonalStorage.FromFile(@“C:\Renewtask.pst”);
var folders = pstStore.RootFolder.GetSubFolders();
var tasksFolderInfo = folders.Where(f => f.DisplayName == “Tasks”).FirstOrDefault();
var tasksFolder = pstStore.GetFolderById(tasksFolderInfo.EntryId);
var items = tasksFolder.GetContents();
foreach(var i in items)
{
var thisObject = pstStore.ExtractMessage(i.EntryId);
var thisTask = thisObject.ToMapiMessageItem() as MapiTask;
//exception occurred in this line
}
This is the sample PST in zip.
RenewTask.zip (14.5 KB)
In the code, I want to get the MapiTask object so that I can get some properties for this task. But an exception occurred when “as”. The sample data has been uploaded, the issue seems related to the recurrence. The task is very simple, but it will automatically generate a new one when the previous one is complete.
Could someone take a look on this issue?
Thanks,