Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook automation to read an entire folder
Message
 
 
À
14/04/2003 21:08:32
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00777521
Message ID:
00778239
Vues:
17
>I need an example of Outlook automation to read an entire folder of emails, such as scanning each email and getting access to its content.

Here is a way to do it, by collecting the information into a cursor and showing the result in a form.
Public oForm
oForm = Createobject("form")
oForm.Width = 600
oForm.height = 500
oForm.AddObject("grid1","grid")
oForm.grid1.Width = 590
oForm.grid1.height = 490
oForm.grid1.ColumnCount = 4
oForm.grid1.Visible = .T.
Create Cursor myEmails (From c(20),daterec d,subject c(20),content M)
oOutLookObject = Createobject("Outlook.Application")
olNameSpace = oOutLookObject.GetNameSpace("MAPI")
myEmails=olNameSpace.GetDefaultFolder(6).Items
For Each loItem In myEmails
	Insert Into myEmails (From,daterec,subject,content) Values;
		(loItem.sendername,loItem.ReceivedTime,loItem.subject,loItem.body)
Next
oForm.grid1.RecordSource="myEmails"
Select myEmails
Locate
oForm.Show()
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform