Solved

get all the contact names from address books

Posted on 2009-04-02
6
183 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
[X]
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
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 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