Contacts not loaded correctly inside .pst file

Hi,

I’ve just noticed that contacts are not loaded correctly inside the .pst file , resulting in a contact item without any properties (or better, with all properties set to blank).
Here’s the code I’m using:

FolderInfo currentFolder = pst.GetFolderById(currentFolderEntryId);
MapiContact contact = service.GetContact(msgUri);
contact.Save(“C:\test\temp\tempContact.vcf”, ContactSaveFormat.VCard);
currentFolder.AddFile(“C:\test\temp\tempContact.vcf”, “IPM.Contact”);

Am I doing something wrong?
Waiting for your reply, thanks and best regards.

@albertose,

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input PST.
  • Please attach the output file that shows the undesired behavior.
  • Please attach the expected output file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Problem solved.
Just have to use this code:
MapiContact contact = service.GetContact(msgUri); currentFolder.AddMapiMessageItem(contact);

@albertose

It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Email, we will be happy to help you.