none
how to retrieve itemID for a particular contact RRS feed

  • Question

  • how to retrieve the itemId for the particular  saved contacts by giveing any input values like givename or any value how to retrieve that pls help me...

    how to delete an particular contacts programmatically.

    how to find the itemid



    shenbagaraj

    Wednesday, December 15, 2010 12:02 PM

Answers

  • I'd suggest you look at using the EWS Managed API http://msdn.microsoft.com/en-us/library/dd637749(v=exchg.80).aspx then all you need is a simple searchfilter (or collection of search filters  if you want to search on more the one property) eg

          ItemView view1 = new ItemView(10);
          SearchFilter sf = new SearchFilter.IsEqualTo(ContactSchema.GivenName, "Bob");
          FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Contacts, sf, view1);
          foreach (Item ii in findResults)
          {
            Console.WriteLine(ii.Id.UniqueId);
            ii.Delete(DeleteMode.SoftDelete);
    

    Cheers
    Glen

    • Marked as answer by cshenbagaraj Thursday, December 16, 2010 7:14 AM
    Thursday, December 16, 2010 2:11 AM

All replies

  • I'd suggest you look at using the EWS Managed API http://msdn.microsoft.com/en-us/library/dd637749(v=exchg.80).aspx then all you need is a simple searchfilter (or collection of search filters  if you want to search on more the one property) eg

          ItemView view1 = new ItemView(10);
          SearchFilter sf = new SearchFilter.IsEqualTo(ContactSchema.GivenName, "Bob");
          FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Contacts, sf, view1);
          foreach (Item ii in findResults)
          {
            Console.WriteLine(ii.Id.UniqueId);
            ii.Delete(DeleteMode.SoftDelete);
    

    Cheers
    Glen

    • Marked as answer by cshenbagaraj Thursday, December 16, 2010 7:14 AM
    Thursday, December 16, 2010 2:11 AM
  • Thanks Glen i got the id
    shenbagaraj
    Thursday, December 16, 2010 7:14 AM