Results 1 to 5 of 5

Thread: How to get name and emails from Outlook 2000?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    78

    Talking

    Hi,

    Does anyone knows how do I get names and emails from my Outlook Contact List/Address Book and load it into say, a combo box?

    I know it's something to do with the Outlook.AddressLists but I can't declare it well.

    Thanks for any help!!!

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    Well, using Outlook 2000 I managed to get the members in my contacts list in a listbox like this:

    Code:
    Private Sub Command1_Click()
    Dim OA As Outlook.Application
    Dim NS As Outlook.NameSpace
    Dim AL As Outlook.AddressList
    Dim AE As Outlook.AddressEntry
        Set OA = CreateObject("Outlook.Application")
        Set NS = OA.GetNamespace("MAPI")
        Set AL = NS.AddressLists("Contacts")
        
        For Each AE In AL.AddressEntries
            List1.AddItem AE.Name
        Next
        Set AE = Nothing
        Set AL = Nothing
        Set NS = Nothing
        Set OA = Nothing
    End Sub
    I suppose you could loop through the addresslists the same way I looped through the addressentries, to get the members from all addresslists.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    78
    Thanks FransC

    BTW, is there any website that gives explanation and details on all the Outlook 2000 objects, properties and methods?

    I try searching in the online MSDN but there isn't much help there

    Thanks a lot!!

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    78
    Update, anyone? Thanks!!

  5. #5
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    A lot of documentation is available in the outlook help for visual basic.

    This is from the standard outlook help:

    Get Help for Visual Basic for Applications
    Open a Microsoft Outlook item.

    On the Tools menu, point to Macro, and then click Visual Basic Editor.

    On the Help menu, click Microsoft Visual Basic Help.
    If you have not previously installed the Visual Basic for Applications support, click Yes to install it.


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