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

Get lotus notes email address list

I have a project where i need to get a list of email addresses from Lotus Notes. I downloaded the MS VB.NET sample code application from IBM's website (http://www.ibm.com/developerworks/lotus/library/domino-msnet/) . Everything works but I'm getting back all the email addresses from names.nsf. The customer says they store addresses from many companies in names.nsf and that the address list I'm looking for is in a Directory. Not sure if Directory is the correct terminology but from what I understand they store each companies addresses in a separate directory.

With the vb.net code below how can I
A) limit the address list to a specifed directory or
B) cycle through the addresses to produce the desired result set.

Any advice would be greatly appriciated.

Thanks,
Glenn

'--------------------------------------------------------------------------------------------

Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs)Handles MyBase.Load
  Dim s As New NotesSession
    s.Initialize()
  Dim db As NotesDatabase
  Dim vw As NotesView
  Dim doc As NotesDocument
    db = s.GetDatabase("ServerName//Domain", "names.nsf", False)
  If Not (db Is Nothing) Then
    vw = db.GetView("_People")
    doc = vw.GetFirstDocument()
    While Not (doc Is Nothing)
      cboNames.Items.Add(doc.GetFirstItem("FirstName").Text + " " +
        doc.GetFirstItem("LastName").Text)
        doc = vw.GetNextDocument(doc)
    End While
  End If
End Sub
0
glenn_r
Asked:
glenn_r
  • 4
  • 3
1 Solution
 
Sjef BosmanGroupware ConsultantCommented:
names.nsf is the name of the server's master directory. Next to the system's users, it contains the whole configuration for all servers in the same Domino domain. Actually, names.nsf is not the proper place to store client information.

You could open other directories, either by name when you know the names, or by using different objects first:
- NotesDirectory and NotesDirectoryNavigator
- NotesDbDirectory and find the directories first

There are some examples in the Help database and in other fora on the net.
0
 
glenn_rAuthor Commented:
sjef,

When you say open other directories do you mean open other .nsf files or directories within the names.nsf file?

Can you give me an example of how to cycle thru the directories in the names.nsf file. Using this I could determine the names of its directories.

Thanks,
Glenn
0
 
Sjef BosmanGroupware ConsultantCommented:
A Domino directory used to be called the Domino Name & Address Book (or NAB). The Domain NAB is a database with contacts and a lot of other things, it contains the configuration per server (mail, web, etc.). Next to the public address book type of database, there are private address books (that may be shared by other people) that take less load with them (less config).

So, names.nsf the the most important Directory of a server. There may be additional directory databases, from other Domino Domains (e.g. clients or test domains), or internal shared directories.

If you don't know these directories by name, you can retrieve the list of databases from the server, scan through them and pick the databases that are marked as Directory (or Address Book).

Oh, and there's another way to get the directories: use the AddressBooks property in NotesSession.
Read this and the example in it:
http://bumble.co.genesee.ny.us/help/help7_designer.nsf/2e73cbb2141acefa85256b8700688cea/02a707852bd9b6f58525704a00410212?OpenDocument
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
glenn_rAuthor Commented:
sjef I'll grant you the original 125 points.

I've tired to enumerate the collection of addressbooks and directories. The same code in my clients environment throws an error that is not descriptive. I'm OK with all the addresses. I know how to get people and their internetemailaddresses. How do I get groups? I need some instruction on how get the groups and return back the email addresses of everyone in the group using a com component from vb.net.

Thanks,
Glenn
0
 
Sjef BosmanGroupware ConsultantCommented:
Well thanks! :-)

People you'll find in the $People view, groups in $Groups... But we careful: a group can contain both names of users and names of other groups. If you want to find ALL users in a group, you'll have to descend the group-tree recursively.
0
 
glenn_rAuthor Commented:
sjef I would like to get a list of groups and then the names and email addresses of each member of the group. Can you give me some sample vb.net code on how to do this?

Thanks,
Glenn
0
 
Sjef BosmanGroupware ConsultantCommented:
Sorry, it doesn't work like that. A group can consist of people and group names, so what you have to do is: if you encounter a group name, search in the $Groups view for the group, then you get all the names, and for each name you do the same.

Here's comparable code in LotusScript:
http://searchdomino.techtarget.com/tip/0,289483,sid4_gci1082346,00.html
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now