Free Support Forum -

MapiTask getSubject() showing a date at the end


I’m trying to list tasks subject from a folder using the following code below:

MessageInfoCollection messageInfoCollection1 = sourceFolder1.getContents();
for (int i = 0; i < messageInfoCollection1.size(); i++) 
	MessageInfo messageInfo1 = (MessageInfo) messageInfoCollection1.get_Item(i);
	MapiMessage message = pst.extractMessage(messageInfo1);	    	
	MapiTask task = (MapiTask) message.toMapiMessageItem();

The output of the above code is something like this:
Delete unused files 2021-02-11T19:02:11Z
Test task 1 2021-02-11T19:02:13Z

My question is: Why the library is showing this date at the end? How can I do to avoid this?


Thank you for the issue description. To my regret, I cannot reproduce your problem (sourceFolder1 symbol is unknown). Could you share a more comprehensive code snippet and PST file, please?


You may use it like this:

sourceFolder1 = pst.getPredefinedFolder(StandardIpmFolder.Tasks);

You can also use any PST file, it always happens.
Thanks for your attention

Thank you for the additional information. To my regret, we cannot reproduce your problem with any PST file. Could you share a PST file sample that can be used to investigate your problem, please?