Link to home
Start Free TrialLog in
Avatar of bfreescott
bfreescottFlag for United States of America

asked on

Accessing the Lotus Notes PAB/NAB from within VBA

Hi all,

I've found very little about accessing the lotus notes address book (names.nsf for the local) from within VBA.  I need to be able to show the addresses and allow the user to pick one or more from the list, not simply search the nsf.  I assume the value(s) will return as an array, so I will likely need help determining how to leverage the array as well without looping through it (if possible).

Thank you!
ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bfreescott

ASKER

Thanks bosman!

I can almost make out what they are attempting to do even with the German (since German is the father language of English), but it seems like they are just accessing the local address book and doing a search on last name.

What I want is to be able to pull the address book inside my app and pick from it.

Qwaletee had something on this, but I couldn't quite get it.
I didn't read the full document, but you might find an example in it:
http://www.redbooks.ibm.com/redbooks/pdfs/sg244856.pdf

What you'd have to do is
- open the appropriate view (e.g. "$People")
- get the first document
- do while not EndOfView
-   get relevant data from the document
-   get the next document
- od
and then your picker.
Bosman,

I assume $People is the view for Contacts.

Do you know the view name for Groups?
Sorry, I might have mislead you. The standard (visible) view for contacts is indeed "People", and for groups it is "Groups". There are also "$People" and "$Groups", but they serve a different purpose.

If you want to present all names as Notes knows them, you might try $NamesFieldLookup, it contains all different names for a person and all group names.
Hi bosman,

I'm having some trouble with this.  The address book I am interacting with here is the user's local address book (names.nsf).  There is no view called $NamesFieldLookup for names.nsf.

I have tried other views (using NotesPeek) and can't seem to find one that provides both the Contacts and the Groups (without the other stuff, e.g. accounts, connections, etc. that those views contain).
I thought $Users was going to be the solution, but it just seems to list everything, including the kitchen sink.

I really need to get this right, so I appreciate your help.  I'd raise the points if i could. =)
If it is the case, then why can't you create your own view with columns and design as such?
If you want this to happen to all the local names.nsf, change the design of names.ntf and refresh/replace the designs of local address book.
I don't want to change anything about my users' address books. I just want to extract certain data from them.
Can Exporting to excel will help you?
It was indeed $Users, sorry... Who cares that it lists the lot, if it serves your purpose. Ah, it shows TOO much. Right... The other views that are use by the Notes client are $PeopleGroupsFlat and $PeopleGroupsHier. Maybe one of those two?
Hi Bosman

I have a couple Notes libraries with which to work here.  I've primarily been using the Domino Objects library and I prefer to use Early binding (just FYI).

However, this task may be easier if I use the Notes Automation Classes library and leverage the UI for the items I want.  This is what I have so far (which successfully opens the local address book (as long as Notes is running):

    Dim Addresses As Variant
    Set notesClient = CreateObject("Notes.NotesUiWorkspace")
   
    Addresses = notesClient.PICKLISTSTRINGS(0, True, "")

I want to be able to fill a listbox with the array returned, but I'm not convinced that I have this right or if I am even heading down the right road.  Thanks for your help!
Doesn't seem to be impossible according to the Help database, so try it out, I'd say.
Bosman,

I'm using the above code to successfully open the UI address book, but I'm having a hard time bringing it into focus and I'm sure it's because I'm calling the dialog from within my code.

Any thoughts on how to "appactivate" or something like that.
I've tried running it from behind a form and in a standard module, but that didn't seem to help/matter.

TIA!
Dunno...

Set/GetActive Window?? Get/SetFocus ??
http://blogs.msdn.com/jfoscoding/archive/2006/08/02/686141.aspx
I didn't get a working answer, but maybe someone will find some of the information in the thread useful.
I don't like a "C" ... Please give me a "B" or accept your own answer.