I take it that if there is more than one invoice for the customer number in the folder, you want to add them all to the message?
In that case the following should work assuming I have understood your PDF file-naming.
Option Explicit
Sub Mail_Attachments()
Dim OutApp As Object
Dim OutMail As Object
Dim sAttach As String
Dim sPath As String
Dim iLastRow As Integer
Dim shtAddr As Worksheet
Dim xlSheet As Worksheet
Dim iRow As Long
Dim LastRow As Long
Set xlSheet = ActiveWorkbook.Sheets("Email Body")
xlSheet.Activate
LastRow = xlSheet.Range("A" & xlSheet.Rows.Count).End(-4162).Row
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set OutApp = CreateObject("Outlook.Application")
LastRow = 3 'THIS LINE IS FOR TESTING ONLY!!!
For iRow = 2 To LastRow
sPath = xlSheet.Range("D" & iRow)
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = xlSheet.Range("C" & iRow)
.Subject = xlSheet.Range("E" & iRow)
sAttach = Dir$(sPath & "*.pdf")
While Len(sAttach) <> 0
If InStr(1, sAttach, xlSheet.Range("A" & iRow)) > 0 Then
.attachments.Add sPath & sAttach
End If
sAttach = Dir$()
DoEvents
Wend
.HTMLBody = "<HTML><BODY>Please find invoice " & sAttach & " attached" _
& "<BR>" & "</HTML></BODY>"
' .Send 'or use .Display
.Display
End With
Next iRow
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set xlSheet = Nothing
Set shtAddr = Nothing
Set OutMail = Nothing
Set OutApp = Nothing
End Sub