Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to extract certain information form Outlook
Message
From
23/02/2005 08:24:03
 
 
To
22/02/2005 23:08:10
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00989502
Message ID:
00989563
Views:
33
>I need to extract from Outlook *or* from Outlook Express (depending on the which current user is using, if any of them) information about the contacts in the database, namely: First and Last Name, Organization, telephone numbers and emails. If a particular, if an organization has several contacts I need them all, and also to know that they are all members of the same organization.

You cannot automate OE.

For outlook you could do something like the following:
* code sample by Marcia Akins
#define olFolderContacts 10
Local loAddressBook AS Outlook.MAPIFolder
Local loContact AS Object
Local lnContactCount AS Integer

*** 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 = loContact
            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( laContacts )
EndIf
For OE, I'd look at http://www.insideoutlookexpress.com/ by Tom Koch [MVP]


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform