473,785 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sort property of outlook contacts not working

TM
I was able to find the code to list the name and email from the contacts in
Outlook 2003, but the sort property is not working.

Here is my sample code. For now I am just adding an item to a listbox with
the fileas name so I can see what is going on. Any idea why the sort is not
working to sort the contacts by FileAs name ?
Dim OutlookApp As New Outlook.Applica tion
Dim OLNameSpace As Outlook.NameSpa ce
OLNameSpace = OutlookApp.GetN amespace("MAPI" )
Dim allContacts As Outlook.MAPIFol der =
OLNameSpace.Get DefaultFolder(O utlook.OlDefaul tFolders.olFold erContacts)

allContacts.Ite ms.Sort("FileAs ")
Dim contact As Outlook.Contact Item
Dim cnt As Integer

lblNumberContac ts.Text = "Total Contacts: " & allContacts.Ite ms.Count
lstContacts.Ite ms.Clear()
For cnt = 1 To allContacts.Ite ms.Count
contact = allContacts.Ite ms.Item(cnt)
lstContacts.Ite ms.Add(contact. FileAs & " " &
contact.Email1A ddress)
Next

'cleanup
OutlookApp = Nothing
OLNameSpace = Nothing

Thanks all
--
Tony
Nov 20 '05 #1
0 1170

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
19348
by: Fritz Switzer | last post by:
Can anyone provide a small snippet in C# that pulls out the Contacts in Outlook XP. I've seen a couple of examples in C++ and VB in previous newsgroup posts, but either the originals didn't work or my conversion skills are weak. And if I have to use tlbimp.exe what is the right file to use. Thanks for the help. -- Fritz
4
17482
by: lauren quantrell | last post by:
Is there a way to open the MS Outlook address book using VBA and then be able to do something with the return value? I want users to click an icon to open the Outlook address book then when an address is selected, populate an Access field with the address. Is this remotely possible? Thanks, lq
1
2537
by: SWu | last post by:
Hello everyone, I am working on an Internet website for an Application Service Provider. A user can store employee details on the site. I am now researching the feasibility of accessing the contacts stored in the user's local Outlook. In other words, the client browser has to be able to access the user's Outlook contacts. Obviously, the user has to permit the browser to access the contacts. I say "client browser" because the...
9
3092
by: George McCullen | last post by:
I have an Outlook 2003 using Exchange Server 2003 Public Contacts Folder containing 20,000 Contacts. I am writing a VB .Net 2003 program that loops through all the contacts in a "for each oCt in oItems" loop. After about 250 contacts, the program gives an InvalidCastException Error on the for each loop. I notice that Outlook's memory keeps increasing (using the task manager) until it reaches around 20,000K. When I run the program a second...
3
6048
by: John | last post by:
Hi I am trying to access outlook contacts folders and delete the contacts that do not contain a certain category value in the categories field. I have written the below code but am stuck with the error on the indicated line. Any help would be appreciated. Thanks Regards
1
4346
by: charliej2001 | last post by:
Hi all My access database has import/export capabiltiy of contact details between outlook. The database is getting big now (1000+ contacts) and so are the outlook address books that have the contacts info in them. When I export contacts from access to outlook, it takes a long time because there are so many contacts in the Outlook address book, and it is checking all of these against the contacts coming in, so as to avoid duplicates....
6
2658
by: Kevin | last post by:
In my business, I use Quickbooks extensively for billing and accounting and a custom built Access DB for project management. I recently began using MS Outlooks contacts quite extensively as well (recently bought a PDA to bring to job sites!). I have been able to get things set up so that I can synchronize my Quickbooks customer and vendor lists with the Outlook contacts, and thus with my PDA and this has been immensely helpful. My DB has...
3
3392
by: Volkan Senguel | last post by:
Hi Is there a easy way to get the contacts (names and phonenumbers) from outlook without the message that someone is accessing outlook and how long the access can take? i have not found any working solution for that :( thanks for any help Volkan
0
2275
by: Roman Optio | last post by:
Hi, I am currently working on a tool to transfer addressbook data such as contacts and organizations between Vondle and Outlook. For those of you who are wondering what Vondle is, it is an online project management toolkit used to support large engineering projects. More information on Vondle can be found at http://www.bricsys.com/vondle/ . The purpose of the tool is to fluently transfer addressbook data between vondle & outlook. I've...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10148
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.