Dim olSpace As Outlook.Namespace
Dim olInbox As Outlook.MAPIFolder
Dim pceJointe As Outlook.Attachment
Dim j As Integer, i As Integer, x As Integer
Set outlookApp = CreateObject("Outlook.Application")
Set olSpace = outlookApp.getNamespace("MAPI")
Set olInbox = olSpace.getDefaultFolder(olFolderInbox)
'boucle sur tous les messages de la boite de réception
For j = 1 To olInbox.Items.Count
If Not olInbox.Items.Item(j).Attachments.Count = 0 Then
For i = 1 To olInbox.Items.Item(j).Attachments.Count
Set pceJointe = olInbox.Items.Item(j).Attachments(i)
x = x + 1
pceJointe.SaveAsFile _
"C:\Documents and Settings\" & "Recup\" & x & "_" & pceJointe
Set pceJointe = Nothing
Next i
End If
Next j