VB Code:
  1. Private Sub oSaveAs_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
  2.    
  3.      Dim oSel As Outlook.Selection
  4.     Dim oEmail As Outlook.MailItem
  5.     Dim oContact As Outlook.ContactItem
  6.     Dim pContact As Outlook.ContactItem
  7. Dim Item As Outlook.MailItem
  8.     Set oSel = Application.ActiveExplorer.Selection
  9.    For Each Item In oSel
  10.    If Item.Class = olMail Then
  11.     Set oEmail = Item
  12.    
  13.         Set oContact = Application.CreateItem(olContactItem)
  14.        
  15.         Set pContact = Application.CreateItem(olContactItem)
  16.        
  17.        With oContact
  18.             .Subject = oEmail.Subject
  19.             .Email1Address = oEmail.SenderEmailAddress
  20.            
  21.             .FullName = oEmail.SenderName
  22.             '.Body = oEmail.Body
  23.          
  24.             .Display
  25.         End With
  26.        
  27.         With pContact
  28.         .FullName = oEmail.SenderName
  29.         .Email1Address = oEmail.SenderEmailAddress
  30.      
  31.         .Display
  32.         End With
  33.        
  34.          If ((oContact.Email1Address = pContact.Email1Address)) Then
  35.    
  36.      
  37.      MsgBox "Contact Exists"
  38.            'pContact
  39.      
  40.       Else
  41.   oContact.Save
  42.      MsgBox "Saved"
  43.      Set oContact = Nothing
  44.         Set oEmail = Nothing
  45.         Set oContact = Nothing
  46.    
  47.     Set oSel = Nothing
  48.  
  49.  End If
  50.  
  51.      
  52.      
  53.  End If
  54.  
  55.  
  56.  
  57.  
  58. Next
  59. End Sub


above is the code i have been working upon. the problem is it is not checking whether the contacts are same but the code is running.
very confused kindly help