lcrawford46
Programmer
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.
Code:
'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