Outlook ContactItem: get containing folder?

616 Views Asked by At

I am maintaining an Outlook add in that manages Outlook contacts. I have a function that gets all the contacts in a folder and its subfolders. Now, I need to determine which folder a given contact was retrieved from. Is this possible without scanning each of the folders or returning the paths along with each of the contact items?

1

There are 1 best solutions below

0
gillonba On

This works for me:

public string GetFolderFullName(Outlook.ContactItem ci) {
    Outlook.MAPIFolder mf = ci.Parent;
    string path = mf.FolderPath;
    return path;
}