Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

get all the contact names from address books

Posted on 2009-04-02
6
179 Views
Last Modified: 2012-05-06
Hi,

Could anyone please tell me whow could I get the all person's names from address book and display it in combobox in Add-in form,?

Thanks.
0
Comment
Question by:deshaw
  • 3
  • 3
6 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 24047948
Hi, deshaw.

Which address book?
0
 
LVL 1

Author Comment

by:deshaw
ID: 24047957
From Global Address List.
Thanks.
0
 
LVL 1

Author Comment

by:deshaw
ID: 24047978
basically i need the list of users in attached dialog.  i think you got it now.
allusers.JPG
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 24048005
Use the code from this question http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_24280084.html with a couple of slight modifications.  

1.  First, change the SELECT statement on line 5 so the command retrieves all users not just the one with the account name 'jdoe'.
2.  Remove line 12 and replace it with commands to populate your pulldown control
Sub GetContactInfo()
    Set rsDetails = Wscript.CreateObject("ADODB.Recordset")
    rsDetails.ActiveConnection = "Provider=ADSDSOObject"
    'Replace DomainName on the following line with the name of your domain and jdoe with the account name you want to search for'
    rsDetails.Source = "SELECT ADsPath, displayName, Company, Department, Division FROM 'LDAP://DomainName' WHERE objectClass='user' AND objectCategory='Person'"
    rsDetails.CursorType = 0
    rsDetails.CursorLocation = 2
    rsDetails.LockType = 1
    rsDetails.Open()
    If Not rsDetails.EOF Then
        With rsDetails
            'Commands to populate your controls go here'
        End With
    End If
    rsDetails.Close
    Set rsDetails = Nothing
End Sub

Open in new window

0
 
LVL 1

Author Closing Comment

by:deshaw
ID: 31565700
thanks so simple. :)
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24048076
You're welcome.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
Find out what you should include to make the best professional email signature for your organization.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question