Domino.NotesSession, Domino.DataBase objects not availble

Posted on 2005-04-13
Last Modified: 2013-12-18

I have an VBA application that has been working for sometime now but after rebuilding after a disk failure, i'm having trouble getting everything to run again.

I delcare a couple of variables, i.e  Public session As New Domino.NotesSession and Public db As New Domino.NotesDatabase but now when I try to compile i get an error "can't file project or library" and the vba reference dialog pops to select a reference to a library.

My question is which file is missing?  I do have a reference to 'Lotus Notes Automation Classes'... I guess the automation classes and the domino objects are not the same?

Question by:backwaterdogs
    LVL 19

    Assisted Solution

    it should be Dim instead of Public.
    And here is a sample code:
    Dim domNotesDocumentMemo As Domino.NOTESDOCUMENT
    Dim domSession As New Domino.NOTESSESSION
    Dim domNotesDBDir As Domino.NOTESDBDIRECTORY
    Dim domNotesDatabaseMailFile As Domino.NOTESDATABASE
    Dim sUser As String

    domSession.Initialize ("")
    sUser = domSession.USERNAME
    Set domNotesDBDir = domSession.GETDBDIRECTORY(sUser)

    Set domNotesDatabaseMailFile = domNotesDBDir.OpenMailDatabase

    ' Create a new memo document.
    Set domNotesDocumentMemo = domNotesDatabaseMailFile.CREATEDOCUMENT

    Call domNotesDocumentMemo.APPENDITEMVALUE("Form", "Memo")
    Call domNotesDocumentMemo.APPENDITEMVALUE("From", domSession.COMMONUSERNAME)
    Call domNotesDocumentMemo.APPENDITEMVALUE("SendTo", "") 'email address must be entered here
    Call domNotesDocumentMemo.APPENDITEMVALUE("Subject", "")
    Call domNotesDocumentMemo.APPENDITEMVALUE("Body", "")

    ' Send the document.
    domNotesDocumentMemo.SEND (False)

    Set domNotesDocumentMemo = Nothing
    Set domNotesDatabaseMailFile = Nothing
    Set domNotesDBDir = Nothing
    Set domSession = Nothing

    Exit Sub

    MsgBox Err.Number & " " & Err.Description

    End Sub
    LVL 31

    Expert Comment

    Did you completely reinstall Lotus Notes?  You may have to register nlsxbe.dll again.
    LVL 31

    Expert Comment

    Oh, should've given the command:
    regsvr32 nlsxbe.dll
    LVL 31

    Expert Comment

    LOL just saw your previous question.

    Listen, just uninstall all copies of Notes, then install a fresh copy of Notes from a clean CD.  You should be OK.  If not, your machine is seriously hosed, and we'll have to do surgery on the registry.

    Author Comment


    thanks for all the input!  I believe notes was completely reinstalled (though I didn't go thru a an uninstall).  Unfortuanately, i don't have complete control over this step as I'm in large company.

    At any rates, notes seems to function otherwise, I have 'Lotus Notes Automation Classes' checked in the VB references box, and nlsxbe.dll was registered with regsvr32.

    Is the way i've delcared my objects part of the problem? i.e. "session As New Domino.NotesSession".  Does using Domino require a different set of classes that need to be referenced?

    I will try an uninstall and reinstall next.

    thanks for all the help!
    LVL 31

    Accepted Solution

    Might be as New Lotus.Domino.NotesSession

    Also, see if old fashioned .CreateObject("Lotus.NotesSession") works, or any of the variants of that object name.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
    Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    759 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

    11 Experts available now in Live!

    Get 1:1 Help Now