Outlook ContactItem: get containing folder?
I am maintaining an Outlook add in that manages Outlook contacts. I have a function that g开发者_如何学Goets 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?
This works for me:
public string GetFolderFullName(Outlook.ContactItem ci) {
Outlook.MAPIFolder mf = ci.Parent;
string path = mf.FolderPath;
return path;
}
精彩评论