Hi, I receive a excel file each date, the title name is the same except ends with the report date and the subject title of the e-mail is the same as the excel report name
I am looking to automate the opening and saving of the attachment,
I have so far managed to get the correct e-mail to open (please see below), but cannot seem to find anywhere how to save the document to shared drive,
The share drive being \\ntfiler01\reports\.
I would Like this to happen from an excel sheet as well as I have automated the refreshing of the report, the only thing I have not automated is the above.
Is there anyone who knows the correct VBA to save an attachment one the correct e-mail is open.
ReportDate= Format(Date - 1, "DD.MM.YYYY")
SubjectName= "Daily Report" & ReportDate
Dim olNs As Namespace
Dim Fldr As MAPIFolder
Dim olMail As Variant
'Dim objAttachments As Outlook.Attachments
Dim i As Integer
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
i = 1
For Each olMail In Fldr.Items
If InStr(olMail.Subject, SubjectName) <> 0 Then
olMail.Display
i = i + 1
End If
Next olMail
End Sub