How to add contacts to All Contacts in directories RRS feed

  • Question

  • Hi,

         I are trying to add contacts and want to show it on all contacts folder in left navigation directory panel. I have used the following code.

                    ExchangeService Exchageser = new ExchangeService(ExchangeVersion.Exchange2010);
                    Exchageser.Credentials = new WebCredentials("administrator", "test", "");
                    Exchageser.Url = new Uri("https://test-exhsvr/ews/exchange.asmx");
                    //Folder rootfolder = Folder.Bind(Exchageser, "Directory");
                    FolderView view = new FolderView(100);
                    view.PropertySet = new PropertySet(BasePropertySet.IdOnly);
                    view.Traversal = FolderTraversal.Deep;
                    FindFoldersResults findFolderResults = Exchageser.FindFolders(WellKnownFolderName.Contacts, view);                                
                    //find specific folder
                    foreach (Folder f in findFolderResults)
                        if (f.DisplayName == "GAL Contacts")
                            FolderId fID = f.Id;
                            Contact objCreatecontact = new Contact(Exchageser);
                            objCreatecontact.GivenName = firstname;
                            objCreatecontact.Surname = lastname;
                            objCreatecontact.EmailAddresses[EmailAddressKey.EmailAddress1] = new EmailAddress("");
                catch(Exception ex)
                    return ex.ToString();

    But the above code helps me to add contact to the specific user. Kindly, let me know is there any possibilities to show the contacts in all contacts folder in left navigation.


    Tuesday, July 14, 2015 7:46 AM


All replies