Solved

Visual Basic & Lotus Notes

Posted on 1998-01-13
8
705 Views
Last Modified: 2013-11-25
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.
0
Comment
Question by:art44
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 5

Expert Comment

by:dirtdart
ID: 1450833
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
 

Author Comment

by:art44
ID: 1450834
Lotus Notes in the manual says it supports MAPI.It allows mail integration between Notes and a MAPI-complaint messaging application.
0
 
LVL 5

Expert Comment

by:dirtdart
ID: 1450835
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 9

Expert Comment

by:cymbolic
ID: 1450836
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
 
LVL 1

Accepted Solution

by:
sachinkas earned 200 total points
ID: 1450837
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
 
LVL 1

Expert Comment

by:sachinkas
ID: 1450838
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
 
LVL 1

Expert Comment

by:sachinkas
ID: 1450839
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
 

Author Comment

by:art44
ID: 1450840
I had to make a few changes to the code but it was very helpful.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide vba in gp 7 93
Add and format columns in vb6 7 56
how to know if my Checkbox is True in VB6.0? 9 54
How can my static class become undefined?? 8 47
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now