Hi, I'm using the following code to search within my outlook excel attachments and save them to a specified path. However, after I save each excel attachment I then want to delete the attachment within outlook. I am using the following code which saves the files to excel fine but only seems to delete one attachment?
i = 0
For Each Item In SubFolder.Items
For Each Atmt In Item.Attachments
If Right(Atmt.FileName, 3) = "xls" Then
FileName = "R:\Doug\FP Rates\PAA\" & Atmt.FileName
Atmt.SaveAsFile FileName
Atmt.Delete
i = i + 1
End If
Next Atmt
Next Item
i = 0
For Each Item In SubFolder.Items
For Each Atmt In Item.Attachments
If Right(Atmt.FileName, 3) = "xls" Then
FileName = "R:\Doug\FP Rates\PAA\" & Atmt.FileName
Atmt.SaveAsFile FileName
Atmt.Delete
i = i + 1
End If
Next Atmt
Next Item