Results 1 to 4 of 4

Thread: Contactitem collection

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    7

    Angry Contactitem collection

    I have a sub in my program to display all the contacts from a public folder. My problem is the performance. Some of company branch have more than 1000 mixed items in a folder (mails, contacts, ...). This is taking more than 60 seconds to get the result . Any idea to decrease the responds time will be appreciate.
    VB Code:
    1. Set olObject = olItems.GetFirst
    2.  
    3. ' For i = 1 To olItems.Count
    4.     While Not (TypeName(olObject) = "Nothing")
    5.    
    6.         If olObject.Class = Outlook.olContact Then
    7. ' Set olSafeContactItem = New Redemption.SafeContactItem
    8. ' olSafeContactItem.Item = olObject
    9.            
    10.             Set olContactItem = olObject
    11. ' With olSafeContactItem
    12.             With olContactItem
    13.                 If optAffichageContacts(mcOptCourriel).Value = True Then
    14.                     If .Email1Address <> "" Then
    15.                         Set itmListItem = lvwContactsPublics.ListItems.Add(, .EntryID, .FullName, , mcIconOutlookContact)
    16.                         Call itmListItem.ListSubItems.Add(, , .Email1Address)
    17.                         Call itmListItem.ListSubItems.Add(, , .CompanyName)
    18.                     End If
    19.                 Else
    20.                     If .BusinessFaxNumber <> "" Then
    21.                         Set itmListItem = lvwContactsPublics.ListItems.Add(, .EntryID, .FullName, , mcIconOutlookContact)
    22.                         Call itmListItem.ListSubItems.Add(, , .BusinessFaxNumber)
    23.                         Call itmListItem.ListSubItems.Add(, , .CompanyName)
    24.                     End If
    25.                 End If
    26.             End With
    27.         End If
    28.    
    29.         Set olObject = olItems.GetNext
    30.    
    31.     Wend
    32.     'Next i
    Last edited by SNick1974; Apr 21st, 2005 at 09:56 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width