Hi All,
I am using a view and getting the collection of documents
The collection come correct , but after the collection is over when I use
Set doc = view.getNextDocument(doc)
I get an error
“This documentis not in the view”
Here is my code:
Dim session As New notesSession
Dim workspace As NotesUIWorkspace
Dim db As NotesDatabase
Dim view As NotesView
Dim dc As NotesDocumentCollection
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim doc1 As NotesDocument
Set db = session.CurrentDatabase
Set view = db.getView("XYZ")
Set doc = view.GetFirstDocument
While Not doc Is Nothing
Dim key1 As String
If doc.SurveySupplier(0) <> "" Then
key1 = doc.SurveySupplier(0) + " - " + doc.SAPID(0)
Else
key1 = doc.SupplierSiteName(0) + " - " + doc.SAPID(0)
End If
Set dc = view.GetAllDocumentsByKey(key1, True)
If dc.count > 1 Then
For i =1 To dc.count
Set doc1 = dc.GetNthDocument(i)
Set doc = doc1
If Not doc1 Is Nothing Then
If doc1.HasItem("PSW1") Then
If doc1.PSW1(0) >= 0 Then
Else
doc1.PSW1 = 0
End If
Else
doc1.PSW1 = 0
End If
End If
Call doc1.Save(True, False)
Next i
Set doc = view.GetNextDocument(doc)
Wend
Please help ,
When I run in the Debug mode i get an error on line "Set doc = view.getNextDocument(doc)
Also I changed it to "Set doc = view.getnextDocument(doc1) and still gives me an error.
My view has many more documents for the While loop to end
Thanks in advance
ac ac