Results 1 to 14 of 14
  1. #1
    Star Lounger
    Join Date
    Apr 2003
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    send lotus note email from listbox (a97)

    I hv created a listbox with 2 columns whereby display all the email addresses in first column and names on the second column. I want to send an email by selecting email address and it will open lotus email. Once the email is open, the email address will auto add to the send to field. May I know is it possible to do in such a matter as I explained?If yes, so how to go about it? pls help..tks.. <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>

  2. #2
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: send lotus note email from listbox (a97)

    I have some code that will send emails using Lotus notes 5.0 from within Access. The email address portion of your listbox is no problem but what do you want to place in the subject line and the body of the email. Where will this info come from? Otherwise you will be sending a blank email to someone.

  3. #3
    Star Lounger
    Join Date
    Apr 2003
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: send lotus note email from listbox (a97)

    Tht means besides of just create to open lotus email, it can also do more than tht? At first, I was thought only once the lotus email is open, I will key in there in the subject line and the body of the email. If Access can do include the subject line and body as well, then what if i create 2 textbox to input subject line and another for body of the email? Is that what I understanding is correct. If so, I can send email direct from Access instead? <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15> <img src=/S/bubbles.gif border=0 alt=bubbles width=31 height=17> <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  4. #4
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: send lotus note email from listbox (a97)

    Take a look at this database.
    I put together a small demo of sending an Email from Access through Lotus Notes using a listbox.
    The table for the listbox source has the email, subject, and message. I don't have Access97 so I converted it from 2000.(it should work)
    Later,
    Scott
    Attached Files Attached Files

  5. #5
    New Lounger
    Join Date
    Feb 2004
    Location
    Hastings, Hawke's Bay, New Zealand
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: send lotus note email from listbox (a97)

    Hi Scott, Nice Code! I am trying to build an app that can use Notes or outlook depending on the users installation.
    Do you know how to determine the mail client please?
    thanks.
    Brian.

  6. #6
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: send lotus note email from listbox (a97)

    Brian,
    I never had to check for that since we use Lotus company wide.
    don't know if this is want you want but....
    you can use a hyperlink to bring up the default mail client
    e.g. mailto: Me@woodys.com
    the link will open up your default mail client

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: send lotus note email from listbox (a97)

    Can someone tell me how to send an attachment with the code that is used to send an email in this database. The following code comes from that database.

    <pre>Private Sub cmdSEND_Click()
    Dim s As Object
    Dim db As Object
    Dim Doc As Object
    Dim rtItem As Object
    Dim Server As String, Database As String
    Dim strError As String
    Dim Item As String
    Dim strWHERE As Variant
    Dim strEMAIL As String
    Dim strSUBJECT As String
    Dim strMSG As String

    If Me.lstEMAIL.ItemsSelected.Count = 0 Then
    MsgBox "You must select at least destination"
    Exit Sub
    End If

    strWHERE = strWHERE & lstEMAIL.Column(0, Item)
    strSUBJECT = strSUBJECT & lstEMAIL.Column(1, Item)
    strMSG = strMSG & lstEMAIL.Column(2, Item)

    ' start up Lotus Notes and get object handle passwords and ID
    Set s = CreateObject("Notes.NotesSession")
    Server = s.GETENVIRONMENTSTRING("MailServer", True)
    Database = s.GETENVIRONMENTSTRING("MailFile", True)
    Set db = s.GETDATABASE(Server, Database)

    On Error GoTo ErrorLogon
    ' See if user is logged on yet;
    ' if not, the error handler will kick in!
    Set Doc = db.CREATEDOCUMENT
    On Error GoTo 0

    Doc.Form = "Memo"
    Doc.Importance = "1" '(WHERE 1=URGENT, 2= NORMAL, 3=FYI)


    'Send an EMail to
    Doc.SENDTO = (strWHERE)

    'SENDS A RETURN RECIEPT
    'doc.RETURNRECIEPT = "1"
    Doc.Subject = strSUBJECT

    ' this will build the text part of your mail message

    Set rtItem = Doc.CREATERICHTEXTITEM("Body")
    Call rtItem.APPENDTEXT(strMSG)
    Call rtItem.ADDNEWLINE(1)

    'Attach a document!

    'Call rtItem.embedobject(1454, "", Attachment)
    '' set all object handles to nothing to release memory
    Call Doc.send(False) 'Make sure this parameter stays false
    Set Doc = Nothing
    Set db = Nothing
    Set s = Nothing
    Set rtItem = Nothing

    MsgBox "Mail has been sent!", vbInformation

    Exit Sub
    ErrorLogon:
    If Err.Number = 7063 Then
    MsgBox "Please login to Lotus Notes first!", vbCritical
    Set Doc = Nothing
    Set s = Nothing
    Set rtItem = Nothing

    Exit Sub
    Else
    strError = "An Error has occurred on your system:" & vbCrLf
    strError = strError & "Err. Number: " & Err.Number & vbCrLf
    strError = strError & "Description: " & Err.Description
    MsgBox strError, vbCritical
    Set Doc = Nothing
    Set s = Nothing
    Set rtItem = Nothing
    Exit Sub
    End If

    End Sub
    </pre>



    I have bolded an instruction above, is this the way to include an attachment?

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: send lotus note email from listbox (a97)

    Hi Scott
    I have a client that needs to email via Lotus Notes. As part of the email process they need to send an attachment (PDF). Does your database example provide the answer. If not, can you or someone else help me.

  9. #9
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: send lotus note email from listbox (a97)

    Pat here is the code to send an attachment.

    Function SendLotus(Attachment) 'sends an email with an attachment
    Dim S As Object
    Dim db As Object
    Dim doc As Object
    Dim rtItem As Object
    Dim Server As String, Database As String
    Dim strError As String

    ' start up Lotus Notes and get object handle
    Set S = CreateObject("Notes.NotesSession")
    Server = S.GETENVIRONMENTSTRING("MailServer", True)
    Database = S.GETENVIRONMENTSTRING("MailFile", True)
    Set db = S.GETDATABASE(Server, Database)

    On Error GoTo ErrorLogon
    ' See if user is logged on yet;
    ' if not, the error handler will kick in!
    Set doc = db.CREATEDOCUMENT
    On Error GoTo 0

    doc.Form = "Memo"
    doc.Importance = "1" '(WHERE 1=URGENT, 2= NORMAL, 3=FYI)


    'Send an EMail to
    doc.SENDTO = ("email@address.com") 'the address you want to send to
    'SENDS A RETURN RECIEPT
    'doc.RETURNRECIEPT = "1"
    doc.Subject = "Type your subject line here"

    ' this will build the text part of your mail message

    Set rtItem = doc.CREATERICHTEXTITEM("Body")
    Call rtItem.APPENDTEXT("Type the body of your email here")
    Call rtItem.ADDNEWLINE(1)

    'Attach a document!
    Call rtItem.EMBEDOBJECT(1454, "", Attachment)

    Call doc.send(False) 'Make sure this parameter stays false

    ' set all object handles to nothing to release memory
    Set doc = Nothing
    Set db = Nothing
    Set S = Nothing
    Set rtItem = Nothing


    MsgBox "Mail has been sent!", vbInformation

    Exit Function

    ErrorLogon:
    If Err.NUMBER = 7063 Then
    MsgBox "Please login to Lotus Notes first!", vbCritical
    Set doc = Nothing
    Set db = Nothing
    Set S = Nothing
    Set rtItem = Nothing

    Exit Function
    Else
    strError = "An Error has occurred on your system:" & vbCrLf
    strError = strError & "Err. Number: " & Err.NUMBER & vbCrLf
    strError = strError & "Description: " & Err.Description
    MsgBox strError, vbCritical
    Set doc = Nothing
    Set db = Nothing
    Set S = Nothing
    Set rtItem = Nothing

    Exit Function
    End If

    End Function

  10. #10
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: send lotus note email from listbox (a97)

    >>Call rtItem.EMBEDOBJECT(1454, "", Attachment)<<

    Is Attachment a path and name of a file to send (eg c:dataearthlyPurchaseOrder.pdf)?

  11. #11
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: send lotus note email from listbox (a97)

    If you plan to do a lot of work automating Lotus Notes from Access/VBA, recommend take a look at this previous thread:

    <!post=Re: Mail via Lotus Notes (Access 2000/xp),352823>Re: Mail via Lotus Notes (Access 2000/xp)<!/post>

    This post has link to the IBM Lotus Notes site:

    Lotus Documentation - Domino and Notes Toolkit for COM Guide

    If you check this site, you'll find a link to download the Notes Toolkit for COM Guide in compiled HTML (.CHM) help file format. In simple terms, "COM" (as in "COM Automation") means that Lotus Notes can be automated using a COM-aware programming language such as VB/VBA. The guide provides code examples in both VB and VB Script, a description of the Domino/Notes object model, and much more useful information. If you intend to work further with Lotus Notes in VBA, recommend download this guide - don't think your VBA "Help" files cover this stuff....

    HTH

  12. #12
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: send lotus note email from listbox (a97)

    Thanks Scott, I will try this at the Client site it that's ok with you.

    Thanks Mark, I am in for some reading but I have to learn this stuff.

  13. #13
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: send lotus note email from listbox (a97)

    Patt,
    The correct usage would be to call the function and supply the file location:
    SendLotus("C:Your document.pdf")

  14. #14
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: send lotus note email from listbox (a97)

    Thanks for your help Scott

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •