Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lotus notes address book

25 views
Skip to first unread message

Francois Houde

unread,
Aug 9, 2005, 9:24:38 AM8/9/05
to
Hi all ! simple question, I'm trying to read the lotus notes address book and
put it in a list so the user can choose the e-mail addresses to whom he wants
to send the e-mail. The part of sending the e-mail is not a problem. I'm
using Lotus Notes R5.

Thanks in advance

Francois Houde

Miyahn

unread,
Aug 12, 2005, 6:33:15 AM8/12/05
to
"Francois Houde" wrote in message news:57A76A83-DDFF-44E1...@microsoft.com

> Hi all ! simple question, I'm trying to read the lotus notes address book and
> put it in a list so the user can choose the e-mail addresses to whom he wants
> to send the e-mail. The part of sending the e-mail is not a problem. I'm
> using Lotus Notes R5.

Hi,
Here is an example.
Only tested on Lotus Notes R6.02 Japanese edition.
Change the field names to available ones on Lotus Notes R5.

Const MAXADDR = 10
GetAddrList(MAXADDR)
'
Sub GetAddrList(MaxN)
Dim nSs, nDb, nVw, nDoc, I, Buf, AddrList()
ReDim AddrList(MaxN - 1)
Set nSs = CreateObject("Notes.NotesSession")
For Each nDb In nSs.AddressBooks
If nDb.IsPublicAddressBook Then Exit For
Next
nDb.Open "", ""
Set nVw = nDb.GetView("People")
Set nDoc = nVw.GetFirstDocument
I = 0
Do While Not (nDoc Is Nothing)
With nDoc
Buf = Array(.GetFirstItem("FullName").Text, _
.GetFirstItem("Department").Text, _
.GetFirstItem("Location").Text, _
.GetFirstItem("JobTitle").Text)
End With
AddrList(I)= Join(Buf, " : ")
I = I + 1: If I > MaxN - 1 Then Exit Do
Set nDoc = nVw.GetNextDocument(nDoc)
Loop
MsgBox Join(AddrList, vbCrLf)
Set nDoc = Nothing: Set nVw = Nothing: Set nDb = Nothing
Set nSs = Nothing
End Sub

--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP for Microsoft Office - Excel(Jan 2005 - Dec 2005)
HQF0...@nifty.ne.jp

0 new messages