Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recipients address not always valid
Message
De
24/04/2003 00:44:18
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Recipients address not always valid
Divers
Thread ID:
00780998
Message ID:
00780998
Vues:
43
I use the following code to extra the entire content of a specific Outlook folder into a DBF:
LOCAL loOutlook,loNS,loInbox,loMailItems,lnCompteur,lnCount,lnCompteur2
loOutlook=CREATEOBJECT('Outlook.Application')
loNS=loOutlook.GetNameSpace('MAPI')
loInbox=loNS.Folders('Personal Folders').Folders('MyFolder')
loMailItems=loInbox.Items
CLOSE ALL
USE Email
DELETE ALL
lnCount=loMailItems.Count
lnCompteur2=0
FOR lnCompteur=lnCount TO 1 STEP -1
   lnCompteur2=lnCompteur2+1
   WAIT WINDOW ALLTRIM(STR(lnCompteur2))+' of '+ALLTRIM(STR(lnCount)) NOWAIT
   loItem=loMailItems.Item(lnCompteur)
   loReply=loItem.Reply()
   APPEND BLANK
   REPLACE AddDate WITH loItem.CreationTime
   REPLACE Sender WITH loItem.SenderName
   REPLACE Subject WITH loItem.Subject
   IF LEN(ALLTRIM(loItem.Body))>0
      REPLACE Notes WITH loItem.Body
      ELSE
      REPLACE Notes WITH loItem.HTMLBody
   ENDIF
   REPLACE To WITH loItem.To
   IF TYPE('loReply.Recipients.Item(1)')='O'
      REPLACE Address WITH LOWER(loReply.Recipients.Item(1).Address)
   ENDIF
   IF TYPE('loItem.Recipients.Item(1)')='O'
      REPLACE ToAddress WITH LOWER(loItem.Recipients.Item(1).Address)
   ENDIF
NEXT
However, for specific emails, when I am in Outlook, when clicking on Reply, I can see the email of the sender. However, loReply.Recipients.Item(1).Address will return a blank value for some of them. How can I update this code to make sure that I will always be able to obtain the same value as in Outlook for the email of the sender?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform