Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan Outlook Contacts from VFP
Message
From
11/10/2000 18:41:40
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Scan Outlook Contacts from VFP
Miscellaneous
Thread ID:
00428211
Message ID:
00428211
Views:
39
Here's a little utility that you may find useful. It scans through the Outlook Contact and recursively processes any subsequent subfolders.

*********************************************************
*Copyright ProgRes, All rights reserved
*Author L.A.Long
*10/10/2000
*********************************************************
* The following code is intended to be used a FreeWare
* provided this header is not modified and that any
* subsequent modifications be noted below.
*********************************************************
* ***************** Modifications ***********************
* DATE - AUTHOR - COMMENTS
*********************************************************
oOutlook=CREATEOBJECT("Outlook.Application")
oNameSpace=oOutlook.GetNameSpace("MAPI")

i=0

DO parsecontacts WITH oNameSpace.GetDefaultFolder(10),''
return

PROC parsecontacts
PARAMETERS oTargetFolder,folderpath
PRIVATE ALL EXCEPT I
oContacts=oTargetFolder.Items
oFolders=oTargetFolder.Folders

store iif(not empty(folderpath),folderpath+'\','')+oTargetFolder.Name to folderpath,parentpath

FOR EACH loFolder IN oFolders
DO parsecontacts WITH oTargetFolder.Folders(loFolder.NAME), folderpath
folderpath=parentpath
ENDFOR

oContacts = oContacts.RESTRICT("[MessageClass] >= 'IPM.Contact' AND [MessageClass] <= 'IPM.Contact'")

*SCAN THRU CONTACTS IN CURRENT FOLDER
WAIT WINDOW 'Press any key to parse folder: '+folderpath

FOR EACH loContact IN oContacts
i=i+1
WITH loContact
WAIT WINDOW ;
.FileAs+CHR(13)+;
.CompanyName TIMEOUT .1
ENDWITH
ENDFOR

RETURN

WAIT WINDOW ALLTRIM(STR(i))+' Total Contacts found'
L.A.Long
ProgRes
lalong1@charter.net
Reply
Map
View

Click here to load this message in the networking platform