Searched the forum and found a useful thread:
http://www.access-programmers.co.uk/forums/showthread.php?t=131103&highlight=email+lotus+notes
The code provided allows emails to be automatically send via Lotus Notes. However I am having an issue with embedding the HTML format report before it is sent.
It looks like the part of the code where:
Is intended to create the attachment and embeds it in the email.
I also tried manually exporting a HTML version ("C:Rpt_Test.html") of the report in the C:/ directory.
Can someone explain the syntax of these object-related commands to help me get it working.
Thanks
http://www.access-programmers.co.uk/forums/showthread.php?t=131103&highlight=email+lotus+notes
The code provided allows emails to be automatically send via Lotus Notes. However I am having an issue with embedding the HTML format report before it is sent.
Code:
Dim objAttachment As Object
Dim objMailDb As Object
Dim objMailDocument As Object
Dim objEmbedObject As Object
Dim objNotesSession As Object
Dim strMailDbName As String
Dim sstring As String
On Error Resume Next
'Start objNotesSession in Lotus Notes
Set objNotesSession = CreateObject("Notes.NotesSession")
'Open the mail database in Lotus Notes
Set objMailDb = objNotesSession.GETDATABASE("", strMailDbName)
objMailDb.OPENMAIL
'Set up the new mail document
Set objMailDocument = objMailDb.CREATEDOCUMENT
objMailDocument.Form = "Memo"
objMailDocument.sendto = strLotusNotesUserID
objMailDocument.Subject = strMailTitle
objMailDocument.Body = strTextBody
objMailDocument.SAVEMESSAGEONSEND = fSaveMailToTheSentFolder
strFileAttachment = "Rpt_Test"
'Set up the embedded object and strFileAttachment and attach it
[B]If strFileAttachment <> "" Then[/B]
[B]Set objAttachment = objMailDocument.CreateHTMLItem("Rpt_PortsQueryEdit")[/B]
[B]Set objEmbedObject = objAttachment.EmbedObject(1454, "", "C:Rpt_Test.html", "Rpt_Test")[/B]
End If
'Send the document
objMailDocument.SEND 0, strLotusNotesUserID
'Clean Up
Set objMailDb = Nothing
Set objMailDocument = Nothing
Set objAttachment = Nothing
Set objNotesSession = Nothing
Set objEmbedObject = Nothing
It looks like the part of the code where:
Code:
Set objAttachment = objMailDocument.CreateHTMLItem("Rpt_Test")
Set objEmbedObject = objAttachment.EmbedObject(1454, "", "C:Rpt_Test.html", "Rpt_Test")
Is intended to create the attachment and embeds it in the email.
I also tried manually exporting a HTML version ("C:Rpt_Test.html") of the report in the C:/ directory.
Can someone explain the syntax of these object-related commands to help me get it working.
Thanks