I have an application that sends a report as an email when the user clicks on the send button. It assembles the report and sends it the the default email app (Lotus Notes).
Unfortunately I have one user that gets the file converted from HTML to XLS and it attaches it to the email. I've tried every option I can think of (associations, Lotus setup, etc..) and nothing seems to work. Something about the setup of this particular machine makes it impossible to insert the HTML into the email. Of course this user is the primary user of the application. I'm hoping someone has run into a similar error or has some experience with using the Lotus Notes OLE interface (another option).
Here's my code for using the MS Access control:
Code:
Private Sub cbEmail_Click()
On Error GoTo Err_cbEmail_Click
' This routine will use the current default email program to send a message - inserting an HTML report in the body
' of the message
' Note that the report "Requests" is reading the form for it's filtering criteria after the button starts the report
Dim stDocName As String 'Report Name
Dim stSubject As String 'Email Subject
Dim stEmailTo As String 'Email addresses
Dim stEmailBody As String 'Email Text - if any
'
'Report name
stDocName = "Requests"
'Insert the Move_Type, Request Number, Receipt date, Description and Status into Subject line of email
stSubject = Me.Move_Type.Column(1) & _
" Request Number:" & Me.RequestID & _
" Date:" & Format(Me.Receipt_Date, "MMDDYY") & _
" - " & Me.RequestDescription & _
" [" & Me.Status.Column(1) & "]"
'Email Addresses - 1 owner, 1 Requestor
stEmailTo = Me.Env_Owner.Column(1) & ", " & _
Me.Env_Requestor.Column(1)
'Email Body
stEmailBody = "Status Message: " & Me.Status.Column(2)
'MsgBox (stSubject) ' debug
DoCmd.SendObject acReport, stDocName, "HTML(*.html)", stEmailTo, "", "", stSubject, stEmailBody, True, ""
Exit_cbEmail_Click:
Exit Sub
Err_cbEmail_Click:
MsgBox Err.Description
Resume Exit_cbEmail_Click
End Sub I'm considering using the Lotus OLE interface, but I'm not sure how I can insert the HTML report into the Lotus message using OLE.