Link Lotus Notes to Visual Basic 6.0

With the introduction of Lotus Notes and Domino Release 5.0.2b, you now
have the ability to manipulate the Domino object model via COM. As a result,
you can use VB 6.0 to take advantage of Lotus/Domino services and databases.

To do so, however, you'll need Lotus Notes client version 5.02.b (or higher),
Domino Designer client, or Domino Server. As with most Visual Basic object
libraries, the programs need not be running to use them. Lotus has plans to
make this runtime package distributable independent of its full software
installation.

Next, set a reference to the Notes back-end DLL, Lotus Domino Objects.
This object model conforms to a hierarchy similar to CDONTS, as seen in the
sample code, which displays a message box with the first name in a Lotus
Notes' address book. Notice that before you can access any of the objects
within the NotesSession, you must initialize a session first.

Dim domSession As New Domino.NotesSession   
Dim domDatabase As New Domino.NotesDatabase
Dim domDocument As NotesDocument
Dim domViewEntry As NotesViewEntry
Dim domView As NotesView
Dim domViewNav As NotesViewNavigator
Dim strName As String

domSession.Initialize
Set domDatabase = domSession.GetDatabase("", _
"names.nsf")  
Set domView = domDatabase.GetView("Contacts")
' This view contains the list of names
Set domViewNav = domView.CreateViewNav
Set domViewEntry = domViewNav.GetFirstDocument()
Set domDocument = domViewEntry.Document

strName = domDocument.GetItemValue("FullName")(0)
MsgBox strName

Set domViewEntry = Nothing
Set domViewNav = Nothing
Set domView = Nothing
Set domDocument = Nothing
Set domDatabase = Nothing
Set domSession = Nothing

You might also like...

Comments

ElementK Journals

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov