Hi,
we’re processing items in PST files and we want to track the ones we already processed via setting a custom property on them like this:
Unfortunately, it doesn’t seem like there is a way to persist this message item back to PST without export / import the item into the folder.private static void MarkMessages(FolderInfo folder)
{
var messageInfoCollection = folder.EnumerateMapiMessages();<span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">"Marking messages"</span>); <span style="color:blue;">var</span> guid = <span style="color:#2b91af;">Guid</span>.NewGuid(); <span style="color:green;">// NewGuid for testing</span> <span style="color:blue;">foreach</span> (<span style="color:blue;">var</span> messageInfo <span style="color:blue;">in</span> messageInfoCollection) { <span style="color:blue;">var</span> nextPropId = messageInfo.NamedPropertyMapping.GetNextAvailablePropertyId(<span style="color:#2b91af;">MapiPropertyType</span>.PT_LONG); <span style="color:blue;">var</span> mapiProp = <span style="color:blue;">new</span> <span style="color:#2b91af;">MapiProperty</span>(nextPropId, <span style="color:#2b91af;">BitConverter</span>.GetBytes(123)); <span style="color:green;">// correct item id be be used</span> messageInfo.NamedPropertyMapping.AddNamedPropertyMapping(mapiProp, <span style="color:#a31515;">"ITEM_ID"</span>, guid); messageInfo.SetProperty(mapiProp); }
}
Is there any possibility to mark a single item (or save a modified message) in place in the PST?
Best regards,
Michal