Hello,
Because I didn’t find such topic, just wanted to check, if possible, you’ve got a sample to do so?
Thanks.
We have logged this requirement in our issue tracking system as EMAILNET-40767. We will inform you once there is an update available on it.
Hi,
Problem is that MapiMessage cannot cast to MapiContact: TryCast(MapiMessage, MapiContact)
Anyway to cast MapiMessage to MapiContact?
We have logged your concerns in our issue tracking system. You will be informed once there is an update available on it.
Please use the following code example to save the contacts in VCF format from OLM. Hope this helps you.
using (OlmStorage olm = OlmStorage.FromFile(fileName))
{
OlmFolder inbox = olm.GetFolder("accounts", true).GetSubFolder("xxx@yyy.com", true).GetSubFolder("inbox", true);
int count = 0;
foreach (OlmMessageInfo messageInfo in inbox.EnumerateMessages())
{
MapiMessage msg = olm.ExtractMapiMessage(messageInfo);
if (msg.MessageClass.StartsWith("IPM.Contact", StringComparison.OrdinalIgnoreCase))
{
MapiContact mapiContact = (MapiContact)msg.ToMapiMessageItem();
mapiContact.Save("output" + count.ToString() + ".vcf", ContactSaveFormat.VCard);
count++;
}
}
}