OK I got it to work.. I think there is a problem with the "|" part of the code. So I just replaced it with a ";" and it worked .
the code looks like this.
Code:'Add attachments to the message. For lngLoop = LBound(Split(strAttachmentPath, ";")) To UBound(Split(strAttachmentPath, ";")) If Not strAttachmentPath = "" Then If Len(Dir(Trim(Split(strAttachmentPath, ";")(lngLoop)))) <> 0 Then Set objOutlookAttach = .Attachments.Add(Trim(Split(strAttachmentPath, ";")(lngLoop))) Else MsgBox "Unable to find the specified attachment '" & Trim(Split(strAttachmentPath, ";")(lngLoop)) & "'. Sending mail anyway." End If End If Next lngLoop




Reply With Quote
Bookmarks