例: FindNthName method

このボタンにより、サーバー上の Domino ディレクトリの [ユーザー] ビューにアクセスして、1 つ以上の名前に一致する各文書の [FullName] アイテムと [InternetAddress] アイテムの値を返します。

Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
	Set session = New NotesSession
	Set directory = session.GetDirectory("myserver/Acme")
End Sub

Sub Click(Source As Button)
	Dim nav As NotesDirectoryNavigator
	Dim msg As String
	Dim value As Variant
	Dim names() As String
	Dim nam As String
	Dim n As Integer
	Dim i As Integer
	Dim items( 1 To 2) As String
	items(1) = "FullName"
	items(2) = "InternetAddress"
	nam = Inputbox$("Enter last name")
	If nam = "" Then Exit Sub
	Do
		n = n + 1
		Redim Preserve names(1 To n)
		names(n) = nam
		nam = Inputbox$("Enter another last name")
	Loop While nam <> ""
	Set nav = directory.LookupNames("People", names, items, True)
	For i = 1 To Ubound(names)
		If nav.FindNthName(i) > 0 Then
			Do
				value = nav.GetFirstItemValue
				msg = msg & Cstr(value(0)) & | |
				value = nav.GetNextItemValue
				msg = msg & Cstr(value(0)) & |
|
			Loop While nav.FindNextMatch
		End If
	Next
	Msgbox msg,, "People"
End Sub