Examples: FindFirstMatch method

This button accesses the "My Contacts" view of the personal address book in the local directory and returns the values of the "FullName" and "InternetAddress" items for each document.

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

Sub Click(Source As Button)
	Dim nav As NotesDirectoryNavigator
	Dim msg As String
	Dim value As Variant
	Dim items( 1 To 2) As String
	items(1) = "FullName"
	items(2) = "InternetAddress"
	Set nav = directory.LookupAllNames("My Contacts", items)
	If nav.CurrentMatches > 0 Then
		nav.FindFirstMatch 'not really needed
		Do
			value = nav.GetFirstItemValue
			msg = msg & Cstr(value(0)) & | |
			value = nav.GetNextItemValue
			msg = msg & Cstr(value(0)) & |
|
		Loop While nav.FindNextMatch
	End If
	Msgbox msg,, "My Contacts"
End Sub