Send email in lotus notes from Access (VBA)
Send email in lotus notes from Access (VBA)
(OP)
Need help to send an email in Lotus Notes from Access. Tried the following code but get an error. Need to open/create a new message. Please help.
'define objects
Set objNotes = GetObject("", "Notes.Notesession")
Set objNotesDB = objNotes.getdatabase("", "")
Call objNotesDB.openmail
Set objNotesMailDoc = objNotesDB.CreateDocument
Call objNotesMailDoc.replaceitemvalue("SendTo", strAddress)
Call objNotesMailDoc.replaceitemvalue("Subject", strSubj)
Call objNotesMailDoc.replaceitemvalue("Body", strBody)
Call objNotesMailDoc.Send(True)
MsgBox "mail OK", vbInformation, "Sender notes-mail..."
Set objNotes = Nothing
'define objects
Set objNotes = GetObject("", "Notes.Notesession")
Set objNotesDB = objNotes.getdatabase("", "")
Call objNotesDB.openmail
Set objNotesMailDoc = objNotesDB.CreateDocument
Call objNotesMailDoc.replaceitemvalue("SendTo", strAddress)
Call objNotesMailDoc.replaceitemvalue("Subject", strSubj)
Call objNotesMailDoc.replaceitemvalue("Body", strBody)
Call objNotesMailDoc.Send(True)
MsgBox "mail OK", vbInformation, "Sender notes-mail..."
Set objNotes = Nothing
RE: Send email in lotus notes from Access (VBA)
Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Dim avarrecip() As Variant
Dim avarattach(1) As Variant
Dim i As Integer
'make new mail message
Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.GetDatabase("", "")
Call notesdb.OPENMAIL
Set notesdoc = notesdb.CreateDocument
Call notesdoc.ReplaceItemValue("Subject", "Put Subject Here")
Set notesrtf = notesdoc.CreateRichTextItem("body")
Call notesrtf.AppendText("Add Additional text here.")
Call notesrtf.AddNewLine(2)
Call notesrtf.EmbedObject(1454, "", avarattach(0), "Attachment")
Call notesrtf.EmbedObject(1454, "", avarattach(1), "Attachment")
'send message
Call notesdoc.Send(False, avarrecip)
Call LogEvent("Emails Sent to " & ListSelection & ".") 'log event
Msgbox "Email sent.", vbOKOnly + vbInformation, "Email Sent"
Set notessession = Nothing
RE: Send email in lotus notes from Access (VBA)
Leslie
landrews@metrocourt.state.nm.us
There are 10 types of people in the world -
those who understand binary
and
those who don't!
RE: Send email in lotus notes from Access (VBA)
-Laughter works miracles.
RE: Send email in lotus notes from Access (VBA)