例: FolderReferencesEnabled property

次のスクリプトはデータベース内に新規文書を作成し、その文書を [view1]、[view2]、[view3] フォルダに入れて、全フォルダ参照と各文書のカウント数を出力します。

Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
If(db.FolderReferencesEnabled) Then
  Messagebox "Folder References enabled"
Else
  Messagebox "Folder References are not enabled"
  Messagebox "Enabling Folder References"
  db.FolderReferencesEnabled = True
End If
db.FolderReferencesEnabled = True
Set doc = db.CreateDocument
If Not (doc Is Nothing) Then
  Call doc.AppendItemValue("Name", "Test Document Name")
  Call doc.AppendItemValue("Topic", "Test Document Topic")
  Call doc.Save(True, True)
  Messagebox "Adding document to views"
  doc.PutInFolder("view1")
  doc.PutInFolder("view2")
  doc.PutInFolder("view3")
  Call doc.Save(True, True)
End If
Dim doccoll As NotesDocumentCollection
Set doccoll = db.AllDocuments
Set doc = doccoll.GetFirstDocument
While Not (doc Is Nothing)
  i=0
  Forall FolderReference In doc.FolderReferences
    i=i+1  
    Messagebox doc.noteid, " ", i, " ", FolderReference
  End Forall
  Set doc = doccoll.GetNextDocument(doc)
Wend
End Sub