В чем ошибка?

dimat

Lotus team
31.07.2008
516
0
#1
Код:
Sub Initialize
Dim ns As New NotesSession
Dim db As NotesDatabase
Dim viewk As NotesView
Dim viewu As NotesView
Dim dock As NotesDocument
Dim docu As NotesDocument
Dim dc As NotesDocumentCollection
Dim i As Integer

Set db=ns.CurrentDatabase
Set viewk=db.GetView("Текущие клиенты")
Set viewu=db.GetView("Текущие клиенты\Обновление БД")
Set dock=viewk.GetFirstDocument
i=1
While Not (dock Is Nothing)
Set dc=viewu.GetAllDocumentsByKey(dock.AgentShortName(0))
Set docu=dc.GetNthDocument(i)
Call docu.ReplaceItemValue("UpdateManagerKodeks", dock.AgentUpdateManager(0))		
Call docu.ReplaceItemValue("UpdateManagerTE", dock.AgentUpdateManagerStroy(0))
Call docu.ReplaceItemValue("UpdateManagerAros", dock.AgentUpdateManagerAros(0))
Call docu.ReplaceItemValue("UpdateManagerAdept", dock.AgentUpdateManagerAdept(0))
Print Cstr(i)+" "+dock.AgentShortName(0)+" "+Cstr(dc.Count)
Set dock=viewk.GetNextDocument(dock)
i=i+1
Wend
End Sub
на этой строчке "Call docu.ReplaceItemValue("UpdateManagerKodeks", dock.AgentUpdateManager(0))" такая ошибка "Object variable not set"
 

Akupaka

А че я?.. О.о
04.10.2007
3 360
1
#2
видать docu is Nothing

Set notesDocument = notesDocumentCollection.GetNthDocument( n& )
Parameters
n& Long. A number indicating the document to return. Use 1 to indicate the first document in the collection, 2 to indicate the second document, and so on.
Return value
notesDocument
NotesDocument. The document in the specified position in the collection. If there is no document at the specified position, returns Nothing.