Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find Outlook Contacts
Message
 
À
16/03/2007 12:52:41
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01204673
Message ID:
01204707
Vues:
46
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform