public IEnumerable<IContact> GetContacts() { Outlook.MAPIFolder folderContacts = _application.ActiveExplorer().Session. GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts); Outlook.Items searchFolder = folderContacts.Items; List<IContact> list = new List<IContact>(); foreach (Outlook.ContactItem foundContact in searchFolder) { OContact oc = new OContact(foundContact); list.Add(oc); } return list; }
public IEnumerable <IContact> GetContacts() { Outlook.MAPIFolder folderContacts = _application.ActiveExplorer().Session. GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts); Outlook.Items searchFolder = folderContacts.Items; List <IContact> list = new List <IContact>(); foreach (Outlook.ContactItem foundContact in searchFolder) { OContact oc = new OContact(foundContact); list.Add(oc); } return(list); }