Examples: Using the Evaluate statement
- This example calls @ProperCase when exiting the Subject field.
The result of Evaluate replaces the current value of the Subject item.
Sub Exiting(Source As Field)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim eval As Variant
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
eval = Evaluate("@ProperCase(Subject)", doc)
Call doc.ReplaceItemValue("Subject", eval)
Call doc.Save(True, False)
End Sub
- This button example calls @Sum, then displays the sum of the values
in the Amounts field.
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim sumAmounts As Variant
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
sumAmounts = Evaluate("@Sum(Amounts)", doc)
Messagebox("Sum of Amounts = " & sumAmounts(0))
End Sub
Have feedback?
Google Analytics is used to store comments and ratings. To provide a comment or rating for a topic, click Accept All Cookies or Allow All in Cookie Preferences in the footer of this page.