Hi Can anyone help with this please? i have written code for excel to save atachements from a subfolder in MS outlook to a drive however the only issue i seem to be having is applying this to only the last email recieved in the subfolder.

Below is my Code

Sub SaveAttachments()

Dim olApp As Outlook.Application
Dim olNs As Namespace
Dim Fldr As MAPIFolder
Dim SubFolder As MAPIFolder
Dim MoveToFldr As MAPIFolder
Dim olMi As MailItem
Dim olAtt As Attachment
Dim MyPath As String
Dim i As Long

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
Set SubFolder = Fldr.Folders("Sales Hourly Feed")
Set MoveToFldr = Fldr.Folders("SalesFeed")
MyPath = "C:\Test\"
For i = SubFolder.Items.Count To 1 Step -1
Set olMi = SubFolder.Items(i)
For Each olAtt In olMi.Attachments
olAtt.SaveAsFile MyPath & "SalesFeed.csv"
Next olAtt
olMi.Move MoveToFldr
Next i

Set olAtt = Nothing
Set olMi = Nothing
Set Fldr = Nothing
Set MoveToFldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub

Thanks in advance for any help.