Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 37,373 times

Related Categories

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

© 2001 Element K Journals, a division of Element K Press LLC ("Element K"). Element K and the Element K logo are trademarks of Element K LLC

Comments

  • Thanks for the post

    Posted by chriscromp on 26 Sep 2005

    Thanks -- this is very helpful
    [url="http://integrity-development.com"]Lotus Notes[/url]

  • vba code for lotus notes

    Posted by rajesh_mannan on 20 Apr 2005

    In case you know how to access lotus notes mails / attachments from VBA, please share with me.

  • vba code for lotus notes

    Posted by rajesh_mannan on 20 Apr 2005

    In case you know how to access lotus notes mail / attachments from VBA, please share with me.

  • May I know...

    Posted by guanxiong on 08 Dec 2003

    Hello,

    May I know how should I apply this part of the program to vb6...
    And also...
    May I know how to create a .nsf database using vb6 programming...:confused:
    Thank You...

    Rgds,
    guanxiong

  • Vb to Lotus notes

    Posted by punnaramesh on 11 Jul 2003

    How can i access Lotus Notes Mail Box and other folders from Visual Basic 6.0.