Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find Outlook Contacts
Message
 
To
16/03/2007 12:52:41
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01204673
Message ID:
01204707
Views:
47
This message has been marked as the solution to the initial question of the thread.
Manfred,

You can use the Find method (for some properties this code will get a warning from outlook, for example for the EMail properties, so you should use the known workarounds, like YesNo or Redemption, for this)
#define olFolderContacts					10

clear
*Any criteria you like
lcCriteria		= '[FirstName] = "SomeFirstName" and [LastName] = "SomeLastName"' 
loOutlookObject		= CreateObject("Outlook.Application")
loMAPIObject		= loOutlookObject.GetNamespace("MAPI")
loFolder		= loMAPIObject.getDefaultFolder(olFolderContacts)
loContacts		= loFolder.Items
loContact		= loContacts.Find(lcCriteria)

do while not Isnull(loContact)
	with loContact
		? .FirstName, .LastName, .BusinessAddress, ;
.BusinessTelephoneNumber, .Birthday, .Email1Address, .Email2Address
	endwith
	loContact		= loContacts.FindNext()
enddo
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform