例: NotesItem class

  1. 次のスクリプトは、文書にテキストアイテム、数値アイテム、日時アイテムという 3 つのアイテムを新規に作成します。
    Dim doc As NotesDocument
    Dim textItem As NotesItem
    Dim numberItem As NotesItem
    Dim dateTimeItem As NotesItem
    '...set value of doc...
    Set textItem = New NotesItem _
    ( doc, "Region", "South America" )
    Set numberItem = New NotesItem( doc, "Earnings", 98 )
    Set dateTimeItem =  New NotesItem _
    ( doc, "LastAccessed", Today )
    Call doc.Save( True, True )
  2. 次のスクリプトは文書にテキストアイテムを新規に作成して複数の値を与えます。テキストリストの値は Bicycle、Train、Foot です。
    Dim doc As NotesDocument
    Dim textListItem As NotesItem
    Dim newValues( 0 To 2 ) As String
    '...set value of doc...
    newValues( 0 ) = "Bicycle"
    newValues( 1 ) = "Train"
    newValues( 2 ) = "Foot"
    Set textListItem = New NotesItem _
    ( doc, "Choices", newValues )
    Call doc.Save( True, True )
  3. 次のスクリプトは文書に Authors アイテムを新規に作成します。アイテムの値は Mariko Nakamura と Pierre Singer です。
    Dim doc As NotesDocument
    '...set value of doc...
    Dim newValues( 1 To 2 ) As String
    newValues( 1 ) = "Mariko Nakamura"
    newValues( 2 ) = "Pierre Singer"
    Dim authorsItem As New NotesItem(doc, "docAuthors",  _
    newValues, AUTHORS)
    Call doc.Save( True, True )