Sub SrhMain
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Dim QueryNotes As String
Dim QueryUser As String
Dim vSrhObject As Variant
vSrhObject = SrhObject(uidoc.FieldGetText( "cSrhObject" ) )
QueryNotes=vSrhObject(0)
QueryUser=vSrhObject(1) & Chr(13)
Dim CategoryFieldDesc(0 To 2,0 To 10, 0 To 2)As String
' Б: 0
CategoryFieldDesc(0,0,0) = Fam_FIELD
CategoryFieldDesc(1,0,0) = Fam_DESC
CategoryFieldDesc(2,0,0) = "cSrhFam"
' Б: 1
CategoryFieldDesc(0,1,0) = Pidp_FIELD
CategoryFieldDesc(1,1,0) = Pidp_DESC
CategoryFieldDesc(2,1,0) = "cSrhSName"
' Б: 2
CategoryFieldDesc(0,2,0) = Tel_FIELD
CategoryFieldDesc(1,2,0) = Tel_DESC
CategoryFieldDesc(2,2,0) = "cSrhPhone"
……………….
Dim CategoryIndex As Integer
Dim vSrhCategory As Variant
Dim bSrhObject As Integer
For CategoryIndex = Lbound(CategoryFieldDesc,2) To Ubound(CategoryFieldDesc,2)
bSrhObject = Cint(vSrhObject(2))
If Not(CategoryFieldDesc(0,CategoryIndex,0)="") Then bSrhObject = 0
If Not(CategoryFieldDesc (1,CategoryIndex,bSrhObject) = "") Then
vSrhCategory = SrhCategory (doc,CategoryFieldDesc(2,CategoryIndex,bSrhObject),CategoryFieldDesc(0,CategoryIndex,bSrhObject), CategoryFieldDesc(1,CategoryIndex,bSrhObject))
If Not(vSrhCategory(0)="") Then
QueryNotes = QueryNotes & BOOL_OPERATOR_EXT & "(" & vSrhCategory(0) & ")"
QueryUser = QueryUser & vSrhCategory(1) & Chr(13)
End If
End If
Next
'******************************************
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim collectionSearch As NotesDocumentCollection
Set db = session.CurrentDatabase
If Not(db.IsFTIndexed) Then Call db.UpdateFTIndex(True)
Set collection = db.FTSearch(QueryNotes, 0,,FT_FUZZY)
Call MakeResult(session,db,collection, QueryNotes,QueryUser)
Exit Sub
End Sub