Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recipients address not always valid
Message
From
24/04/2003 00:44:18
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Recipients address not always valid
Miscellaneous
Thread ID:
00780998
Message ID:
00780998
Views:
42
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
Next
Reply
Map
View

Click here to load this message in the networking platform