Dim fso, folder, files Set fso = CreateObject("Scripting.FileSystemObject") Set folder = fso.GetFolder("d:\Apps\Facilitor\Fplace5i\CUST\PCHW\export\EXACT") Set files = folder.Files For each folderIdx In files If InStrRev(folderIdx.Name, ".xml") > 0 Then Set objEmail = CreateObject("CDO.Message") objEmail.From = "no_reply@pchw.facilitor.nl" objEmail.To = "fa@pch-dienstengroep.nl" objEmail.Subject = "Facilitor: Bestand met inkoopfacturen Westland" objEmail.Textbody = "Automatisch verzonden bestand van geexporteerde facturen." objEmail.AddAttachment "d:\Apps\Facilitor\Fplace5i\CUST\PCHW\export\EXACT\" + folderIdx.Name objEmail.Send End If Next