Hi! Im new here and really looking forward to learn about vba , in the meantime, I wanted to ask your kind help in order to sort this out.
I receive several different pdf files on outlook, the subject will always be the invoice number, then customers name.
I have an excel list , and what I want to achieve is basically run a macro so that way it will search for a file within a folder (files are named after the emails subject) then attach it and send it to the contact person on the list.
So far I have the following code:
Sub macro()
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
Dim fso
Dim file As String
For I = 2 To Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
But the thing s all I have been able to achieve is to send emails with the same file attached (in this case the file on E2)
Anything you guys can suggest ? running out of options