no access to notes/domino objects within VBA

Posted on 2004-11-23
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
    LVL 24

    Assisted Solution

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

    LVL 24

    Assisted Solution

    Also use DIm Session (not as object)
    LVL 31

    Accepted Solution

    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

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
    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…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    779 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