Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing email addresses in Outlook
Message
De
02/11/2004 06:53:52
 
 
À
01/11/2004 12:04:49
Stan Vaninger
Mitek Industries, Inc
Missouri, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
00956609
Message ID:
00956932
Vues:
16
Hi Stan.

I want to rerieve all the email addresses in one of the contact lists of our Outlook Address Book.

Below is some code to get the contacts from the address book into an array. What you do with the array is up to you < s >.
#define olFolderContacts 10
#define olContact        40
LOCAL loAddressBook AS Outlook.MAPIFolder, loContact AS Object, lnContactCount

*** Get a reference to the contacts folder
loOutlook = CREATEOBJECT( 'Outlook.Application' )
loNameSpace = loOutlook.GetNameSpace( 'MAPI' )
loAddressBook = loNameSpace.GetDefaultFolder( olFolderContacts )
IF VARTYPE( loAddressBook ) = 'O'
  lnContactCount = 0
  *** Get info about each contact into the array
  FOR EACH loContact IN loAddressBook.Items
    WITH loContact
      *** Make sure we only get individual contacts
      *** and skip any distribution lists
      IF .Class = olContact
	lnContactCount = lnContactCount + 1
	DIMENSION laContacts[ lnContactCount, 4 ]
	laContacts[ lnContactCount, 1 ] = .LastName
	laContacts[ lnContactCount, 2 ] = .FirstName
	laContacts[ lnContactCount, 3 ] = .Email1Address
	laContacts[ lnContactCount, 4 ] = .FullName
      ENDIF
    ENDWITH
  ENDFOR
  ASORT( This.aContacts )
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform