Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing the Global Address List
Message
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00395702
Message ID:
00395778
Views:
11
>I need to import people from the MS Outlook Global Address List into my programs database but how do I retrieve people from the Global Address List.

Here is VFP code I have used to stuff the names from the Global Address List into a VFP table. Translation to VB should be pretty simple.

CREATE TABLE getlist (name C(50))
oOlApp = CREATEOBJECT("Outlook.Application")
IF TYPE("oOlApp") # "O"
MESSAGEBOX("Could not start Outlook!")
RETURN
ENDIF
oNameSpace = oOlApp.GetNameSpace("MAPI")
oAddressList = oNameSpace.AddressLists("Global Address List")
oAddressEntries = oAddressList.AddressEntries
FOR EACH oAddressEntry IN oAddressEntries
WAIT WIND NOWAIT "Inserting: " + oAddressEntry.Name
INSERT INTO getlist VALUES (oAddressEntry.Name)
ENDFOR
*-*

The syntax in the following lines is also correct:
oAddressList = oNameSpace.AddressLists("Global Address List")
oAddressList = oNameSpace.AddressLists("Personal Address Book")
oAddressList = oNameSpace.AddressLists("Contacts")
?oAddressList.AddressEntries(2).Name && print record # 2
?oAddressList.AddressEntries(2).Address
George
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform