Re: Exporter mails dans fichiers texte
bonsoir Will
pour commencer , je t'invite à lire la
Charte XLD , nottament le premier chapitre
J'espere que la modification ci dessous repondra à ta demande
Option Explicit
Dim OLapp As Outlook.Application
Dim OLspace As Outlook.NameSpace
Dim OLinbox As Outlook.MAPIFolder
Dim OLfolder As Outlook.MAPIFolder
Dim OLmail As Outlook.MailItem
Dim OLpj As Outlook.Attachment
Private Sub TransfertMailsDansFichiersTextes()
Dim OLbody As String
Dim Cible As Integer
Dim i As Byte
Set OLapp = CreateObject("Outlook.application")
Set OLspace = OLapp.GetNamespace("MAPI")
Set OLinbox = OLspace.GetDefaultFolder(olFolderInbox)
For Each OLmail In OLinbox.Items
If OLmail.SenderName = "NomExpediteur, Prénom" Then
OLbody = OLmail.Body
i = i + 1
Cible = FreeFile
'adapter chemin fichier de suivi sur le reseau
Open "C:\Documents and Settings\ " & i & " NomExpediteur Prenom.txt" For Append As #Cible
Print #1, OLbody
Close #Cible
End If
Next
Set OLapp = Nothing
Set OLspace = Nothing
Set OLinbox = Nothing
End Sub
bonne soiree
michel