Hi Leute,
erstmal danke an alle die mir geschrieben haben, habe aber noch ein Problem, welches die erfahreneren Programmierer sicherlich eher lösen als ich es kann.
Mein Agent besteht aus folgendem Quellcode:
Dim Session As New NotesSession
Dim database As NotesDatabase
Dim notesdocument, branchendocument As NotesDocument
Dim BranchenID As String
Dim strSearch As String
Dim firmencollection As NotesDocumentCollection
Dim formitem, fielditem, fielditem2 As NotesItem
Dim boxType As Long
Dim documentcount, firmencount, branchencount, help1, help2, help3, help4, help5, help6, answer, answer2 As Integer
Set database = session.CurrentDatabase
strSearch = |Form = "Kontakt"|
Set firmencollection = database.Search(strSearch, Nothing, 0)
documentcount = firmencollection.Count
help1 = 1
help2 = 1
help3 = documentcount / 20
help4 = help3
help5 = 5
help6 = help5
Do While help1 < documentcount
Set notesdocument = firmencollection.GetNthDocument(help2)
Set formitem = notesdocument.GetFirstItem("BranchenID")
BranchenID = formitem.values(0)
If BranchenID <> " " Then
Set branchendocument = branche.GetDocumentByKey(BranchenID, True)
Set fielditem = branchendocument.GetItemValue("BRHBR")
Set fielditem2 = branchendocument.GetItemValue("BRUBR")
Call fielditem.CopyItemToDocument(Kontakt, "HBranche")
Call fielditem2.CopyItemToDocument(Kontakt, "NBranche")
End If
If help3 < help1 Then
boxType& = MB_YESNO + MB_ICONQUESTION
answer = Messagebox("Weiterlaufen lassen? Bisher abgearbeitet " + help5 + "%.", boxType&, "Continue?")
If answer = 7 Then
Exit Do
End If
help3 = help3 + help4
help5 = help5 + help6
End If
help1 = help1 + 1
help2 = help2 + 1
Loop
Der Debugger bringt eine Fehlermeldung in Zeile:
"Set branchendocument = branche.GetDocumentByKey(BranchenID, True)".
Die Fehlermeldung lautet:
"Variant does not contain an object"
Könnt ihr mir das bitte mal erklären?