Sub Queryrecalc(Source As Notesuiview, Continue As Variant)
Dim view As NotesView
Dim doc As NotesDocument
Set view = Source.View
view.AutoUpdate = False
Set doc = view.GetFirstDocument
Do While Not doc Is Nothing
Call doc.ReplaceItemValue("Categories", _
doc.Categories(0) & "0")
Call doc.Save(True, False)
Set doc = view.GetNextDocument(doc)
Loop
End Sub
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Set db = session.CurrentDatabase
Set view = db.GetView("All")
Messagebox view.TopLevelEntryCount,, view.Name
Dim doc As New NotesDocument(db)
Call doc.ReplaceItemValue("Form", "Main Topic")
Call doc.ReplaceItemValue("Subject", "New document")
Call doc.Save(True, True)
view.AutoUpdate = False
Set doc = view.GetFirstDocument
While Not(doc Is Nothing)
Set doc = view.GetNextDocument(doc)
Wend
REM The entry count is the same
REM because the view is not automatically refreshed when
REM GetFirstDocument or GetNextDocument accesses the
REM new document
Messagebox view.TopLevelEntryCount,, view.Name
End Sub
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Set db = session.CurrentDatabase
Set view = db.GetView("All")
Messagebox view.TopLevelEntryCount,, view.Name
Dim doc As New NotesDocument(db)
Call doc.ReplaceItemValue("Form", "Main Topic")
Call doc.ReplaceItemValue("Subject", "New document")
Call doc.Save(True, True)
Set doc = view.GetFirstDocument
While Not(doc Is Nothing)
Set doc = view.GetNextDocument(doc)
Wend
REM The entry count is incremented reflecting the
REM new document
REM because the view is automatically refreshed when
REM GetFirstDocument or GetNextDocument accesses the
REM new document
Messagebox view.TopLevelEntryCount,, view.Name
End Sub