Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook known addresses
Message
De
11/01/2001 09:20:55
 
 
À
11/01/2001 09:08:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00461695
Message ID:
00462167
Vues:
18
>Tamar
>
>Sometimes an address can be entered incomplete, is there a way of obtaining the FULL address name from the Outlook api when only entering a minimal length address?
>
>Thanks
>Kev

First, realize that Outlook is really smart about this stuff. If it can figure out who you mean from the fragment, it'll do so. That appears to be true, even for a partial email address.

OTOH, if Resolve returns .F., you could do a manual search through the Contacts folder to look for a match. But, if Resolve couldn't resolve the string, that means it's ambiguous. The one thing that I'm not sure whether Resolve handles is matching e-mail addresses that aren't the primary e-mail, so looping through Contacts would be helpful there.

In addition, if you just want to look up a person or an e-mail address, you can do it by going through the Contacts folder. This example is based on one of the examples in the book Della Martin and I wrote about automating Office:

#DEFINE olContacts 10
oOutlook = CreateObject("Outlook.Application")
oNameSpace = oOutlook.GetNameSpace("MAPI")

* Get Contacts folder
oContacts = oNameSpace.GetDefaultFolder( olContacts )


lFound = .F.
FOR EACH oContact IN oContacts.Items

WITH oContact

IF .LastFirstSpaceOnly = cYourString
* Found it
lFound = .T.
EXIT
ELSE
IF .Email1Address = cYourString
* Found it
lFound = .T.
EXIT
ELSE
IF .Email2Address = cYourString
* Found it
lFound = .T.
EXIT
ELSE
IF .Email3Address = cYourString
* Found it
lFound = .T.
EXIT
ENDIF
ENDIF
ENDIF
ENDWITH
ENDFOR

IF lFound
* Do whatever
ENDIF

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform