Solved

VB with Lotus Notes Mail

Posted on 1998-07-22
5
692 Views
Last Modified: 2008-02-01
We currently have VB.-app sending emails to respective clients using an OLE constructed with help of MAPI ( I believe ) communicating with MS-Exchange Mail.
In near future we are planning to Move to Lotus-Notes Mail, I was looking for 1-1 converting tool or API which I  can use to program with VB.
i.e. use to create an OLE so that I could send an email/Fax via Lotus Notes from VB. App.
0
Comment
Question by:anuravi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 3

Accepted Solution

by:
jjmartin earned 100 total points
ID: 1466392
Here is some code that will let your VB app tag into the existing Lotus Notes mail.  Include the lotus notes api in your program references.  

Private Sub cmdEmail_Click()

    Dim Resp As Integer
    Dim Server As String
    Dim UserDef As String
    Dim DefFile As String
    Dim NOTESSESSION As Object
    Dim NOTESDATABASE As Object
    Dim NOTESDOCUMENT As Object
    Dim NotesRichText As Object
   
    'Each person will have to have a different user definition file to access their Lotus Notes email, otherwise this has to be hardcoded in.... bad idea.
    'This is kept in a text file for easier change and update.
    DefFile = App.Path + "\userdef.txt"
    Open DefFile For Input As #1
         Input #1, Server, UserDef
    Close #1
   
    'This is an example of what the definitions need to look like.
    'Server = "PHX_SHR_NOTES03/blahblahblah"
    'UserDef = "MAIL\jmartin.nsf"
   
   
   
   
        'Here is where we tag into the Lotus Notes email system to send the email.
            Set NOTESSESSION = CreateObject("Notes.NotesSession")
            Set NOTESDATABASE = NOTESSESSION.GETDATABASE(Server, UserDef)
            'This is an example of what this looks like without the variables.
            'Set NotesDatabase = NotesSession.GetDatabase("PHX_SHR_NOTES03/American Express", "MAIL\jmartin.nsf")
            Set NOTESDOCUMENT = NOTESDATABASE.CREATEDOCUMENT
            Set NotesRichText = NOTESDOCUMENT.CREATERICHTEXTITEM("Body")

            NOTESDOCUMENT.Subject = txtSubject.Text 'This is the subject of the email an appears in the subject line
            NOTESDOCUMENT.Body = txtMessage.Text   'This is the actual message of the email
            NOTESDOCUMENT.SendTo = Email(lstNames.ListIndex)    'Here is the email address of the person your emailing to.
            NOTESDOCUMENT.SAVEMESSAGEONSEND = False 'This has to be set to False or we get errors
            NOTESDOCUMENT.SEND False    'Keep this set to false.
        End If
    End If
   
End Sub

Let me know if you have anymore questions.
0
 
LVL 3

Author Comment

by:anuravi
ID: 1466393
Appreciate your answer, did clear some of my doubts regarding api. I have a question though, The Lotus Notes API would it come with MS-Windows/ Notes Mail/Where???
I would like To know the exact name of the api, if possible.
Thanking u in anticipation.
0
 
LVL 3

Expert Comment

by:jjmartin
ID: 1466394
This API will come with notes.  It is called the Lotus Notes Automation Classes.  The file is called notes32.tlb
0
 
LVL 3

Expert Comment

by:jjmartin
ID: 1466395
This API will come with notes.  It is called the Lotus Notes Automation Classes.  The file is called notes32.tlb
0
 

Expert Comment

by:ckhlam
ID: 2603308
This method will limited the mail client usabilitied.
If the VB application only need email send/received capilities, using MAPI client provided by Lotus Notes is a choice.
If so, you can using MAPI control in VB. I am using this method in my project.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question