hello Forum,
i'm using a for loop to attach several files to an email from a specific folder. the name of the file is the same as the information from a cell (+.tif extension).
i managed to make this work but i would like that if it happends that the file is not found in the specific folder , to promt a message to the user that the specific file is not found and display the message [rather than sending it] so that the user can attach manually the file.
i'm using a for loop to attach several files to an email from a specific folder. the name of the file is the same as the information from a cell (+.tif extension).
i managed to make this work but i would like that if it happends that the file is not found in the specific folder , to promt a message to the user that the specific file is not found and display the message [rather than sending it] so that the user can attach manually the file.
Code:
If cell.Offset(0, 5).Value = "BONUSES" Then
Set OutlookMsg = Outlook.CreateItem(olMailItem)
With OutlookMsg
' set basic params
.Subject = "Zahlung des Bonus" & Format(Date, " dd/mm/yyyy")
.HTMLBody = "Sehr geehrte Damen und Herren, " & "<br><br>"
For h = cell.Offset(0, 2).Value To cell.Offset(0, 3).Value '
.Attachments.Add "C:\Documents and Settings\730001108\Desktop\Stapples\Invoice Matching for AP\tiff files\" & Cells(h, 4).Value & ".TIF", olByValue, 1
Next h
.To = cell.Value
.display
End With
End If