Click to See Complete Forum and Search --> : Address book


mymm
October 1st, 2001, 06:51 PM
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.

Cakkie
October 2nd, 2001, 09:26 AM
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
slisse@planetinternet.be

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

mymm
October 2nd, 2001, 06:44 PM
Thanks alot...

jamesgriff
December 12th, 2001, 03:29 PM
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

Cakkie
December 13th, 2001, 12:45 AM
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
slisse@planetinternet.be
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?

scriptslave
January 16th, 2002, 04:19 PM
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