Thanks in advance
Francois Houde
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