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.
Printable View
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.
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
Thanks alot...
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
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?
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