次のビューアクションは、現在のビューで選択されている文書の Amount アイテムの合計を計算します。
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim uiview As NotesUIView
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim total As Double
Set uiview = ws.CurrentView
Set dc = uiview.Documents
Set doc = dc.GetFirstDocument
While Not (doc Is Nothing)
If doc.HasItem ("Amount") Then
total = total + Cdbl (doc.GetItemValue ("Amount") (0))
End If
Set doc = dc.GetNextDocument (doc)
Wend
Messagebox total,, "Total amount"
End Sub