no access to notes/domino objects within VBA

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?

thanks!
backwaterdogsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HemanthaKumarCommented:
Try CreateObject("Lotus.NotesSession")... If that fails the install is not proper

~Hemanth
0
HemanthaKumarCommented:
Also use DIm Session (not as object)
0
qwaleteeCommented:
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)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
qwaleteeCommented:
What actually solved it, my friend with the good ol' boy name?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.