Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing the Global Address List
Message
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00395702
Message ID:
00395778
Vues:
10
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform