Answered How to read LastNumber in contact

Answers

All Replies

  • Tuesday, May 26, 2009 1:03 PM
     
     

    Hi,

    What do you mean by last number? Can you please explain more about it? Please find the code to add the contacts to listview.

    private void AddContacts() 
    
    {
    
     
    
    
    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());
    
    lviewContacts.Items.Add(listViewItem);
    
     
    
    }
    
    }
    
    

    Regards,
    Malleswar

  • Tuesday, May 26, 2009 1:19 PM
     
      Has Code
    Last Number is the last type number that user make (for example if I have a contact with mobile, business and home phone. I call Business, I would like find the information that I make business call (last number) for that contact)
  • Tuesday, May 26, 2009 3:04 PM
     
     Proposed Answer
    Hi Claudio,

    In that case, you need check all the numbers(from last contact number)  whether it is existing. 


    Just to retrieve the business telephone number

    GetSessionObject().Contacts.Items[j].BusinessTelephoneNumber


    if you are talking about the call history(P/Invoke)
    http://www.codeproject.com/KB/mobile/wm_callhistory.aspx?display=Print

    Regards,
    Malleswar
  • Wednesday, May 27, 2009 6:13 AM
     
     
    Hi, Malleswar
    this is a good idea, but if I delete call history, the information in my contatcs list of last call is maintained.
    I find a microsoft article http://msdn.microsoft.com/en-us/library/bb415504.aspx: The Smart Property (PIMPR_SMARTPROP) is the Contact property that contains the property ID of the default communication mode. This becomes the phone number or address displayed on the second line of the two-line display in the Contact list view, and highlighted in the Contact summary tab.” but I do not know like reading that property.

    Thanks
  • Thursday, May 28, 2009 1:26 PM
     
     Answered

    Hi, I've just blogged about this topic and maybe you can find the didactic sample code useful: http://blogs.msdn.com/raffael/archive/2009/05/28/the-right-approach-to-get-a-contact-s-last-communication-iitem-s-pimpr-smartprop.aspx. Thanks for the idea! :-)
     

     


    Thanks,
    ~raffaele
    http://blogs.msdn.com/raffael

    This posting is provided 'as is' with no warranties and confers no rights.