Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read address book from outlook
Message
From
09/03/2004 07:04:30
 
 
To
09/03/2004 04:20:54
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00884347
Message ID:
00884374
Views:
19
hi all how do i read addres book data from microsoft outlook, and get in to my data bases/tabel, thank's sample code would be help.
#define olFolderContacts 10
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
Previous
Reply
Map
View

Click here to load this message in the networking platform