×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Send email in lotus notes from Access (VBA)

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

RE: Send email in lotus notes from Access (VBA)

Dim rst As Recordset
    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)

That's impressive!  I do VBA from Delphi to Excel and Word, but have never had reason to call Lotus Notes.  A star for you!!

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)

I am trying to send an email via Lotus Notes in ACCESS 2000 in the backgroud when a specific date has been reached.  I want to attach a query to the email (basically a list of documents they need to verify).  Thanks!

-Laughter works miracles.

RE: Send email in lotus notes from Access (VBA)

On the lotus site, search for DCO. There is a VBA example for free there.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close