Examples: Evaluate method

This Visual Basic code changes all the Subject items in a view to proper case.

Private Sub Evaluate_Click()
Dim s As New NotesSession
s.Initialize
Dim dir As NotesDbDirectory
Dim db As NotesDatabase
Dim v As NotesView
Dim doc As NotesDocument
Set dir = s.GetDbDirectory("")
Set db = dir.OpenDatabase("Web test")
Set v = db.GetView("Main View")
Set doc = v.GetFirstDocument
While Not (doc Is Nothing)
    eval = s.Evaluate("@ProperCase(Subject)", doc)
    Call doc.ReplaceItemValue("Subject", eval)
    Call doc.Save(True, False)
    Set doc = v.GetNextDocument(doc)
Wend
End Sub