The code below works fine except that the file does not attach to the email. Can someone tell me what I'm doing wrong? I can get the code to work (to attach a file) if I don't use Redemption, but then I get the Outlook security message, which is what I'm trying to circumvent by using Redemption. So, I guess the question is, how do you attach a file to an Outlook email using Redemption? Is there different code or syntax that must be used?



Please help!!

Thanks,
Manuel

Code:
Sub SendEmail(ByRef EmailID As Integer, ByRef olTo As String, ByRef olCc As String, ByRef olBcc As String, _
ByRef olSubj As String, ByRef olBody As String, Path As String, blnErr As Boolean, blnEmpty As Boolean)
On Error GoTo email_error
 
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Dim objSafeMail As Object
Dim strBody As String
 
strBody = "You do not have any loans on the Demand or VOM reports."
 
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
' REDEMPTION OBJECTS: once you have your Outllook MailItem
' object allocated, save it as a Redemption.SafeMailItem object.
 
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = MailOutLook
 
With objSafeMail
.BodyFormat = olFormatPlain 'olFormatRichText
.To = olTo
.CC = olCc
.BCC = olBcc
.Subject = olSubj
If blnEmpty = True Then
.Body = strBody 'RM does not have loans on reports
Else
.Attachments.Add (Path)
.Body = olBody
End If
'.Send
.Display
'.DeleteAfterSubmit = True 'This would let Outlook send th note without storing it in your sent bin
End With
 
Error_out:
Set appOutLook = Nothing
Set MailOutLook = Nothing
Exit Sub
 
email_error:
MsgBox "An error has occured. Please take a screen shot of this error" & vbCrLf & _
"and forward it to the system administrator." & vbCrLf & vbCrLf & _
"Error Number " & Err.Number & ": " & Err.Description, vbCritical, "ERROR"
blnErr = True
Resume Error_out
 
End Sub