PDA

View Full Version : 怎样判断某人是不是存在数据库的通讯录中


sissi235
01-11-06, 02:56 PM
如题!有没什么库函数实现

document
02-11-06, 10:20 AM
Sub Click(Source As Button)
Dim session As New NotesSession
Dim books As Variant
Dim view As NotesView
Dim doc As NotesDocument
Dim done As Variant
Dim person As String
books = session.AddressBooks
done = False
person = Inputbox$ _
( "Enter the last name of the person: ", "Last name" )
Forall b In books
' check every Domino Directory,
' unless we're already done
If ( b.IsPublicAddressBook ) And ( Not done ) Then
Call b.Open( "", "" )
' look up person's last name
' in People view of address book
Set view = b.GetView( "People" )
Set doc = view.GetDocumentByKey( person )
' if person is found, display the phone number item
' from the Person document
If Not ( doc Is Nothing ) Then
Messagebox( "Phone for " + person _
+ " is " + doc.OfficePhoneNumber( 0 ) )
done = True
End If
End If
End Forall
' if done is still False, the person wasn't found
If Not done Then
Messagebox _
( "Sorry, unable to locate person's name." )
End If
End Sub
在幫助文件里找的,參考參考.