CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Address book

  1. #1
    Join Date
    Sep 2001
    Posts
    9

    Address book

    Please help me the way to take the email address in the address book...Just tell me which function,api i have to use ..I need this Infos much.please help.
    Thanks alot.



  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Address book

    This code should do the trick (requires outlook to be installed). Just add a listbox to the form.

    set myOlApp = CreateObject("Outlook.Application")
    set myNameSpace = myOlApp.GetNamespace("MAPI")

    ' attention here
    strAddressBook = "Contacts"
    set myAddressList = myNameSpace.AddressLists(strAdressBook)

    set myAddressEntries = myAddressList.AddressEntries

    for i = 2 to myAddressEntries.Count

    List1.AddItem myAddressEntries.GetNext

    next



    At the line i noted with Attention, this will take the name of the addressbook you need. this could be:
    Contacts
    Personel Address book
    Global Address Book
    ...???




    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Sep 2001
    Posts
    9

    Re: Address book

    Thanks alot...


  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    3

    Re: Address book

    When I run this is VB6 on Win98 it says:
    Run time error 429:
    ActiveX component can't create object.

    Please help

    Thanx

    WWWhy not visit James Griffiths' web site @ www.jamesgriff.co.uk

  5. #5
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Address book

    This can only be when Outlook isn't installed (or isn't installed properly). Also note that this might have something to do with outlook security patch (if installed).

    Tom Cannaerts
    [email protected]
    Moderator on http://www.vbcodelibrary.co.uk/board

    A bottomless pit, I'm sure it came with the place, who would dig one on purpose?
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  6. #6
    Join Date
    May 2001
    Posts
    17

    Re: Address book

    How about people with only outlook express using the WAB? Is there a way to use automation to extract info from the Windows Address Book?

    -E


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

Featured