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

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!
0
bfreescott
Asked:
bfreescott
  • 7
  • 7
  • 2
1 Solution
 
Sjef BosmanGroupware ConsultantCommented:
Hope you read German...

http://www.ms-office-forum.net/forum/showthread.php?t=207582

VBA is VBA though.
0
 
bfreescottAuthor Commented:
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.
0
 
Sjef BosmanGroupware ConsultantCommented:
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.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
bfreescottAuthor Commented:
Bosman,

I assume $People is the view for Contacts.

Do you know the view name for Groups?
0
 
Sjef BosmanGroupware ConsultantCommented:
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.
0
 
bfreescottAuthor Commented:
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. =)
0
 
madheeswarCommented:
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.
0
 
bfreescottAuthor Commented:
I don't want to change anything about my users' address books. I just want to extract certain data from them.
0
 
madheeswarCommented:
Can Exporting to excel will help you?
0
 
Sjef BosmanGroupware ConsultantCommented:
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?
0
 
bfreescottAuthor Commented:
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!
0
 
Sjef BosmanGroupware ConsultantCommented:
Doesn't seem to be impossible according to the Help database, so try it out, I'd say.
0
 
bfreescottAuthor Commented:
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!
0
 
Sjef BosmanGroupware ConsultantCommented:
Dunno...

Set/GetActive Window?? Get/SetFocus ??
http://blogs.msdn.com/jfoscoding/archive/2006/08/02/686141.aspx
0
 
bfreescottAuthor Commented:
I didn't get a working answer, but maybe someone will find some of the information in the thread useful.
0
 
Sjef BosmanGroupware ConsultantCommented:
I don't like a "C" ... Please give me a "B" or accept your own answer.
0
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

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