Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook Message elements
Message
De
27/03/2005 07:58:22
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00999322
Message ID:
00999328
Vues:
21
Hi Rex.


With received messages, I need the date I received it, who sent it to me and their email address

This one is harder than it seems < s >. Whil did a column in FoxTalk back around November of 2002 called "Lookout, It's Outlook!". It was a followup of a kitbox column that Andy and I did and I remember helping him out with this part of it because he was having terrible problems trying to make it work. Here is some of the code we used:
*** Get a local referenece to the collection of of items in the current folder
loItems = toFolder.Items

*** Process all the items in the current folder
*** If it is a mail item, save it and process the attachments
IF VARTYPE( loItems ) = 'O'
  FOR EACH loItem IN loItems
    IF loItem.Class = 43  && olMail	
      *** Add a record to the messages table
      *** store list of recipients as well
      lnCount = loItem.Recipients.Count
      lcRecip = ''
      FOR lnRecip = 1 TO lnCount
        loRecipient = loItem.Recipients[ lnRecip ]
        lcRecip = lcRecip + loRecipient.Name + ': ' + loRecipient.Address + CHR( 13 ) + CHR( 10 )
      ENDFOR

      *** First see if the sender name actually IS an e-mail address
      IF '@' $ loItem.SenderName
        lcSenderEm2 = loItem.SenderName
      else
        if empty(loItem.To)
          *** don't reply - this is just a draft
          lcSenderEm2 = "Draft"
        else
          loReply = loItem.Reply()
          loRecip = loReply.Recipients[ 1 ]
          lcSenderEm2 = IIF( NOT EMPTY( loRecip.Address ), loRecip.Address, loRecip.Name )
        endif
      ENDIF
      INSERT INTO SaveMail ( omInDate, omSender, omSubject, omBody, omFolder, omRecip, omSenderEm, omSenderEm2 ) ;
	VALUES ( loItem.ReceivedTime, loItem.SenderName, loItem.Subject, loItem.Body, toFolder.Name, lcRecip, lcSenderEm, lcSenderEm2 )
      *** Now see if we have attachments
      IF loItem.Attachments.Count > 0
        This.SaveAttachments( loItem )
      ENDIF
    ENDIF
  ENDFOR
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform