0 votes
ago by (120 points)

Is it possible to delete only the duplicate contacts from my Outlook or PST file, without affecting or deleting my emails, calendar events, or other entries stored in the same file?

1 Answer

0 votes
ago by (75.5k points)

Please note that none of the Rebex products support Outlook PST files.

If you want to organize contacts on your Exchange server, you can use Rebex EWS and list contacts like this:

var client = new Rebex.Net.Ews();
client.Connect(...);
client.Login(...);

var list = client.GetItemList(EwsFolderId.Contacts);

Unfortunately, Rebex EWS library does not provide high level API for contact entries. However, you can still process the XML representation and then delete duplicate entries like this:

foreach (var c in list)
{
    // get XML representation of the contact
    string xml = c.ToXml();

    // process contact ...

    // delete the contact if needed
    if (isDuplicate)
        client.DeleteItem(c.Id);
}
...