• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 949
  • Last Modified:

Domino.NotesSession, Domino.DataBase objects not availble

Folks,

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?

thanks!!!!!
0
backwaterdogs
Asked:
backwaterdogs
  • 4
2 Solutions
 
madheeswarCommented:
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

ErrorHandler:
MsgBox Err.Number & " " & Err.Description

End Sub
0
 
qwaleteeCommented:
Did you completely reinstall Lotus Notes?  You may have to register nlsxbe.dll again.
0
 
qwaleteeCommented:
Oh, should've given the command:
regsvr32 nlsxbe.dll
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
qwaleteeCommented:
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.
0
 
backwaterdogsAuthor Commented:
Gents,

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!
0
 
qwaleteeCommented:
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.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now