Dim view As NotesView
Dim ns As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim j As Integer
Dim i As Integer
Dim st As String
Set db=ns.CurrentDatabase
Set view=db.GetView("Komment")
view.AutoUpdate = False
Set xl= CreateObject("Excel.Application")
xl.visible = False
xl.Workbooks.Add "d:\счета.xls"
Set xlWorkbook = xl.Workbooks(1)
Set xlWorksheet = xlWorkbook.Worksheets(1)
Set doc=view.GetFirstDocument
While Not(doc Is Nothing)
With xlWorksheet
For j=2 To 91
If Instr(doc.Agent_shet(0), .cells(j,1))>0 Then
Call doc.ReplaceItemValue("Update_comment_for_pyu", .cells(j,2))
Call doc.ReplaceItemValue("UpdateContactKriteriu", .cells(j,3))
End If
Next
End With
Call doc.Save(True, True)
Set doc=view.GetNextDocument(doc)
i=1+1
Wend
xl.visible=True
xl=""