Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003

    Unanswered: Querying Lotus Notes

    Does anyone know how or where to get the information for querying my lotus notes mail server to get a list of names and addresses contained in a mail list?

  2. #2
    Join Date
    Sep 2003
    After some more googling I came across an extremely valuable VB Tip of the week:

    The Visual Basic Tip of the Week is provided by Element K Journals, publishers of Inside Visual Basic, a monthly publication for Visual Basic users.

    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

    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

    Set domDatabase = domSession.GetDatabase("", _
    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

    The tricky part is knowing the name of the "View" you need to open.
    As far as the "values", I just exported the address book I needed from the network to a local text file and it listed all of the field names for me.
    Last edited by ottomatic; 09-30-03 at 15:07.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts