|
-
Apr 21st, 2005, 08:39 AM
#1
Thread Starter
New Member
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:
Set olObject = olItems.GetFirst
' For i = 1 To olItems.Count
While Not (TypeName(olObject) = "Nothing")
If olObject.Class = Outlook.olContact Then
' Set olSafeContactItem = New Redemption.SafeContactItem
' olSafeContactItem.Item = olObject
Set olContactItem = olObject
' With olSafeContactItem
With olContactItem
If optAffichageContacts(mcOptCourriel).Value = True Then
If .Email1Address <> "" Then
Set itmListItem = lvwContactsPublics.ListItems.Add(, .EntryID, .FullName, , mcIconOutlookContact)
Call itmListItem.ListSubItems.Add(, , .Email1Address)
Call itmListItem.ListSubItems.Add(, , .CompanyName)
End If
Else
If .BusinessFaxNumber <> "" Then
Set itmListItem = lvwContactsPublics.ListItems.Add(, .EntryID, .FullName, , mcIconOutlookContact)
Call itmListItem.ListSubItems.Add(, , .BusinessFaxNumber)
Call itmListItem.ListSubItems.Add(, , .CompanyName)
End If
End If
End With
End If
Set olObject = olItems.GetNext
Wend
'Next i
Last edited by SNick1974; Apr 21st, 2005 at 09:56 AM.
-
Apr 21st, 2005, 11:36 AM
#2
Re: Contactitem collection
Are you using a .Restrict or a .Find to populate your olItems object?
I see comments on redemption. Are you using it also or the OOM only?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 21st, 2005, 12:07 PM
#3
Thread Starter
New Member
Re: Contactitem collection
I dont use restrict or find because those functions are a kind of string filter. I dont want to filter, i want to display all the contacts of the current folder. I have the redemption object to avoid the outlook security message, but even if i remove it, i have the same result (too long).
If you dont have a tip or a hint, i will force the company branch to reorganize their public folders.
-
Apr 21st, 2005, 12:18 PM
#4
Re: Contactitem collection
No tips if your getting all the folder contents. They are just to large for Outlook to perform quickly. Outlook
is not know for its speed 
Edit: One tip would be to organize your item into folders by type. Contacts in one folder, MailItems in another, etc.
Last edited by RobDog888; Apr 21st, 2005 at 12:21 PM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|