Bonsoir,
J'ai a nouveau une autre question.
Voici un code qui permet de lister les mails contenu dans la boite de reception d'outlook et de les lister dans excel.
Quels modifs je dois faire dessus pour y rajouter la boite d'envoi egalement?
Merci d'avance pour vos reponses.
Nico
Sub LitMessagerie()
Set olApp = CreateObject("Outlook.Application")
Set olns = olApp.GetNamespace("MAPI")
Set olxFolder = olns.GetDefaultFolder(6) ' olns.GetDefaultFolder(olFolderInbox)
Sheets("Litmessagerie").Select
On Error Resume Next
n = 2
For Each i In olxFolder.Items
Cells(n, 1) = i.Subject
Cells(n, 2).ClearComments
Cells(n, 2).AddComment Text:=Replace(i.Body, Chr(13), "")
Cells(n, 2).Comment.Shape.Height = 150
Cells(n, 2).Comment.Shape.Width = 300
Cells(n, 3) = i.SenderName
Cells(n, 4) = i.CreationTime
n = n + 1
Next
End Sub
J'ai a nouveau une autre question.
Voici un code qui permet de lister les mails contenu dans la boite de reception d'outlook et de les lister dans excel.
Quels modifs je dois faire dessus pour y rajouter la boite d'envoi egalement?
Merci d'avance pour vos reponses.
Nico
Sub LitMessagerie()
Set olApp = CreateObject("Outlook.Application")
Set olns = olApp.GetNamespace("MAPI")
Set olxFolder = olns.GetDefaultFolder(6) ' olns.GetDefaultFolder(olFolderInbox)
Sheets("Litmessagerie").Select
On Error Resume Next
n = 2
For Each i In olxFolder.Items
Cells(n, 1) = i.Subject
Cells(n, 2).ClearComments
Cells(n, 2).AddComment Text:=Replace(i.Body, Chr(13), "")
Cells(n, 2).Comment.Shape.Height = 150
Cells(n, 2).Comment.Shape.Width = 300
Cells(n, 3) = i.SenderName
Cells(n, 4) = i.CreationTime
n = n + 1
Next
End Sub