Пример #1
0
 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;
 }
Пример #2
0
        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);
        }