no access to notes/domino objects within VBA

Posted on 2004-11-23
Medium Priority
Last Modified: 2013-12-18
I've been browsing many entries on this subject and have numerous versions of the sample code but to no avail.

My issue is simple enough, I'm trying to get at the notes objects to simply add an attachment to a notes document (db other than email) but I can't get past the 1st line of code:

dim session as New NotesSession, also have tried late binding as well.  I've set the reference to "Lotus Notes Automation Classes" within the VBA editor, but I don't seem to have access to all the same objects.  Is there another file I need to add the need references to these objects?

Here is a simplified snippet I've tried:

Sub anothertest()
Dim session As New NOTESSESSION
End Sub

Results in "invalid use of new keyword", so try late binding:

sub anothertest()
Dim session As Object
Set session = CreateObject("Notes.NotesSession")
Call session.Initialize("")
end Sub

results in "Object does not support that property or method"

Hopefully, I'm doing something simple and stupid wrong and someone can help.  I have notes client 6.x installed, are there some other files I need?

Question by:backwaterdogs
  • 2
  • 2
LVL 24

Assisted Solution

HemanthaKumar earned 400 total points
ID: 12667666
Try CreateObject("Lotus.NotesSession")... If that fails the install is not proper

LVL 24

Assisted Solution

HemanthaKumar earned 400 total points
ID: 12667671
Also use DIm Session (not as object)
LVL 31

Accepted Solution

qwaletee earned 1600 total points
ID: 12669863
You can try Dim Session as New Lotus.NotesSession or as New DOmino.NotesSession

try including the tlb in your project as well.

The automation classes are Notes.NotesSession, which is a different beast.  Lotus.NotesSesison and Notes.NotesSession are standard COM libaries.  The Automation Classes are an OLE automation class represented by Notes.NotesSession, and actually control teh NOtes client, not the clientless API.

If you use Notes.NotesSession, the Notes client must open, and everything happens in teh user interface.  You don't use Session.Initialize, because the client prompts for credentials.  The COM objects don't use teh client, so you use Session.Initialize to establish credentials.

If Notes isn't registered corrctly, none of the classes will work.  You can try regsvr32 nlsxbe.dll
Failing that, you may wish to re-install Notes.  You should just be able to install the same version over the existing one without uninstalling or specifying any options, and that will basically force the system to be registered.  Just make sure to install all the clients you used to have (plain client, or client+deisgner, client+admin, client+admin+designer)
LVL 31

Expert Comment

ID: 12702666
What actually solved it, my friend with the good ol' boy name?

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month14 days, 10 hours left to enroll

839 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