Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Duesseldorf, Germany
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automated E-Mails with Lotus Notes (Access 2002)

    Hello,
    I would like to create automated E-Mails from the contents of an Access table which will contain E-MAil adresses and a file-name to be sent.
    I found a library called "Domino", but there is no documentation available how to use Office (XP) Automation with Lotus Notes (without Outlook).
    Anyone able to help? I'm sure there is at least one among all the cracks here.
    <img src=/S/hello.gif border=0 alt=hello width=25 height=29>

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automated E-Mails with Lotus Notes (Access 2002)

    Horst,

    Unfortunately I can't help, but I will give you a word of warning that I got from out Lotus Notes Developer (We don't use it for mail, but for a "database")

    If you are using Notes R5 of higher, it should be doable. If it is version 4.x you will probably have some challenges. 4.x doesn't play well with automation, at least according to our Notes Developer. R5 is supposed to have VBA integrated with it, but I can't confirm that since I only have 4.6

    I know this isn't much help.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Duesseldorf, Germany
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automated E-Mails with Lotus Notes (Access 2002)

    Thanks, we are using Version 5.0 <img src=/S/barf.gif border=0 alt=barf width=64 height=23>

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

    Re: Automated E-Mails with Lotus Notes (Access 2002)

    Horst,
    Here is the code I use to send an email with 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 = ("firstaddress@somewhere.com","secondaddress@somew here.com")
    'SENDS A RETURN RECIEPT
    'doc.RETURNRECIEPT = "1"
    doc.Subject = "Place your subject text here"

    ' this will build the text part of your mail message

    Set rtItem = doc.CREATERICHTEXTITEM("Body")
    Call rtItem.APPENDTEXT(GetBody)
    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
    Usage SendLotus "C:yourdocument.doc"

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Location
    Duesseldorf, Germany
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automated E-Mails with Lotus Notes (Access 2002)

    Thanks, <img src=/S/eyeout.gif border=0 alt=eyeout width=15 height=15>
    what library did you use?
    I found 2, one is called "Lotus Domino Objects", the other one "Lotus Notes Automation Classes" with the main difference that the latter does not contain the constants.
    Is there any written documentation available on how to automate with LN?

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

    Re: Automated E-Mails with Lotus Notes (Access 2002)

    Both libraries are in the references but neither is checked off.
    I'm not sure which one it is using.
    I got most of my info from this site:
    http://www-10.lotus.com/ldd/46dom.nsf?OpenDatabase

  7. #7
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Automated E-Mails with Lotus Notes (Access 2002)

    Hi,

    I found this post while searching on automation for Lotus Notes. Code work great but is there a way to get the email to open
    and view it before it sends. That is, the email is created and automatically sends but I want to populate all data and have the email
    visible before sending in the event the body needs to be edited. The user physically send the email after it is created.

    Thanks.
    Regards,

    Gary
    (It's been a while!)

  8. #8
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Reading/Swindon, Berkshire, United Kingdom
    Posts
    664
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automated E-Mails with Lotus Notes (Access 2002)

    I was going to apologise about the time-delay in replying, but I'm not sure that's necessary? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    I was hoping that you could do it by amending the code:

    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Call doc.Save(False, False)
    Call doc.SEND(False, doc.SendTo)
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    to

    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Call doc.Save(False, False)
    Call doc.Activate
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    However, .Activate is not a method of the NotesDocument Class: doc.Save does, however, put the document in the draft folder, so you could navigate to that and open it manually...

    My mind is fuzzy when it comes to notes, but I'm sure I remember seeing code that does activate/open a document in the User interface, but I can't find how to do it using NotesDocuments or NotesItems. It may be possible to get at the draft by the NotesUIView class so that you can then activate it using one of the other NotesUI classes. I'll keep looking for you, but I'm afraid I can't promise anything. Hopefully the manually opening the draft will tide you over.

  9. #9
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Automated E-Mails with Lotus Notes (Access 2002)

    Thanks again Brooke. I changed the design of the structure such that the body of the email was reviewed prior to sending so the email would not need to be reviewed when sending to each individual since I couldn't solve the limitation on the 256 characters in the Send Object.

    Ultimately, here is what I did.

    1. Users select a listing of users to send an email to
    2. Users Press a button to create a .PDF of a report and write it to their local drive
    3. Users press a button to send email that loop through each name, create the email, attach the .PDF and send out the Lotus Notes email.
    Regards,

    Gary
    (It's been a while!)

Posting Permissions

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