Visual Basic & Lotus Notes

What is the best way to develop a VB & lotus notes program? Is using MAPI the best way and does Lotus have any codes that are used with the MAPI? Any examples would be helpful.
art44Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dirtdartCommented:
Lotus Notes isn't MAPI compliant.  The Notes mailboxes are actually "Databases" that reside on a central server (or can be localized).  One way would be to try using ODBC on the database (I haven't tried this yet, so I don't know if it will work).  Notes is also DDE compliant, so you can share information in that way.  If you have the notes documentation, there is also a set of Notes API calls that can be helpful in developing Notes applications.
0
art44Author Commented:
Lotus Notes in the manual says it supports MAPI.It allows mail integration between Notes and a MAPI-complaint messaging application.
0
dirtdartCommented:
It supports the Lotus Notes Application sending MAPI compliant mail.  This lets it interface with another mail server to send and receive messages.  It doesn't use MAPI sessions like Outlook or Eudora.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

cymbolicCommented:
Lotus Notes is reputed to be an ActiveX container application, so you have some leverage via that route.  Also, notes is extendable using their own component(s) architecture, so bridge building potentials exist there.  Go to Lotus.com andcheck out their component architecture area for other ideas.  
0
sachinkasCommented:
Hi art44,

According to me, the best way to create a notes-vb program is to use the notesclassed in vb. They can be used by using the methods & properties in these classes of objects created by createobject as shown in the sample code.
This sample code stores the richtextitem in the vb form to the underlying notesdatabase (here test.nsf)

Attached is sample code to create a notes document and append an attachment file to that document.



Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtitem As Object
Dim embed_object As Object

Set session = CreateObject("Notes.NotesSession")
Set db = session.GetDatabase("Notes1", "training\analyst\test.nsf")     'Test.nsf is a notesdatabase. Change it acc. to yours
Set doc = db.CreateDocument()
doc.Form = "Main"
doc.t_title = "This is a test"
doc.t_body = "Ole Automation"


Set rtitem = doc.Createrichtextitem("t_attachment")
Set embed_object = rtitem.embedobject(1452, "", "c:\test\test.xls", "")

Call doc.Save(True, False)

If U have any doubts contact at sachinkas@hotmail.com

From SachinKas
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sachinkasCommented:
Hi Art,

I have send you one more code. Check your mail.

Else this is the code,

Actually there should be no question of names.nsf as this file is the address book database and is no way related the program.
Is notesclient loaded on the m/c where this program from vb is running,
and is your notesclient getting connected to the server
If it is, and still there are problems then do these simple steps:
1. Create a database named say trials.nsf
2. In trial.nsf create a form named sample and a textfield say txtsample
3. Go in VB and paste  the following code:

* if your database is on your server then specify the server name in
*the statement
* Set db = session.GetDatabase("<servername>", "c:\notes\data\f.nsf")  
'Put here the path  of your database.

*or else make sure your data base is local and put in it,
Set db = session.GetDatabase("", "c:\notes\data\f.nsf")   'Put here the path



Private Sub Form_Load()
Dim session As Object
Dim db As Object
Dim doc As Object

Set session = CreateObject("Notes.NotesSession")
Set db = session.GetDatabase("", "c:\notes\data\f.nsf")   'Put here the path
of your database.

MsgBox "connection established"
Set doc = db.CreateDocument()
doc.Form = "sample"
doc.txtsample = "hello"



Call doc.Save(True, False)
End Sub

Just give a proper path.
This works.

From sachinkas@hotmail.com
0
sachinkasCommented:
Hi Art,

1. Change the name f.nsf to trials.nsf in the VB code
2. Go in Notes and open the database trials.nsf
3. In that open the document and you will see Hello.

Check your mail

From sachinkas@hotmail.com
 


0
art44Author Commented:
I had to make a few changes to the code but it was very helpful.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.