Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Accessing the Lotus Notes PAB/NAB from within VBA

Posted on 2009-12-17
16
Medium Priority
?
968 Views
Last Modified: 2013-12-18
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
Comment
Question by:bfreescott
  • 7
  • 7
  • 2
16 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 1000 total points
ID: 26072825
Hope you read German...

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

VBA is VBA though.
0
 

Author Comment

by:bfreescott
ID: 26084631
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 26086467
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:bfreescott
ID: 26112077
Bosman,

I assume $People is the view for Contacts.

Do you know the view name for Groups?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 26116563
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
 

Author Comment

by:bfreescott
ID: 26142968
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
 
LVL 19

Expert Comment

by:madheeswar
ID: 26143574
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
 

Author Comment

by:bfreescott
ID: 26143718
I don't want to change anything about my users' address books. I just want to extract certain data from them.
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 26143775
Can Exporting to excel will help you?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 26144196
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
 

Author Comment

by:bfreescott
ID: 26185797
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 26186179
Doesn't seem to be impossible according to the Help database, so try it out, I'd say.
0
 

Author Comment

by:bfreescott
ID: 26276630
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 26276709
Dunno...

Set/GetActive Window?? Get/SetFocus ??
http://blogs.msdn.com/jfoscoding/archive/2006/08/02/686141.aspx
0
 

Author Closing Comment

by:bfreescott
ID: 31667259
I didn't get a working answer, but maybe someone will find some of the information in the thread useful.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 26345653
I don't like a "C" ... Please give me a "B" or accept your own answer.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

577 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