locked
How to get get email id's from contacts in Windows mobile 6.0? RRS feed

  • Question

  • Hi ,

    please tell me How to get get email id's from contacts in Windows mobile 6.0?

    Friday, June 3, 2011 5:14 AM

Answers

  • Hi,
    Use this code and please let me know if you face any problems while using this code:
     
     
    using Microsoft.WindowsMobile.PocketOutlook;
     
     private void AddContacts()
        {
    
          ListViewItem listViewItem;
    
    
          OutlookSession _outlookSession = new OutlookSession();
    
    
    
    
          for (int i = 0; i < _outlookSession.Contacts.Items.Count; i++)
          {
    
            listViewItem = new ListViewItem(_outlookSession.Contacts.Items[i].ItemId.ToString());
    
    
    
    
            //_outlookSession
    
            listViewItem.SubItems.Add(_outlookSession.Contacts.Items[i].FirstName + _outlookSession.Contacts.Items[i].LastName);
    
            listViewItem.SubItems.Add(_outlookSession.Contacts.Items[i].MobileTelephoneNumber.ToString());
    
            listViewItem.SubItems.Add(_outlookSession.Contacts.Items[i].HomeTelephoneNumber.ToString());
    
            listViewItem.SubItems.Add(_outlookSession.Contacts.Items[i].Email1Address.ToString());
    
            lviewContacts.Items.Add(listViewItem);
    
    
    
    
    
          }

    Regards, Malleswar
    • Proposed as answer by Jesse Jiang Monday, June 6, 2011 9:42 AM
    • Marked as answer by Jesse Jiang Tuesday, June 14, 2011 7:54 AM
    Friday, June 3, 2011 9:18 AM