Examples: AppendItemValue method

  1. This script adds two new items to a document: a number item called EstimatedCost with the value 89, and a text item called Region with the value "Pacific Rim."
    Dim doc As NotesDocument
    '...set value of doc...
    Dim itemA As NotesItem
    Dim itemB As NotesItem
    Set itemA = doc.AppendItemValue( "EstimatedCost", 89 )
    Set itemB = doc.AppendItemValue( "Region", "Pacific Rim" )
    Call doc.Save( False, True )
  2. This script achieves the same result using the extended class syntax. The difference is that if an item with the name EstimatedCost or Region already exists in the document, its value is replaced by the new value.
    doc.EstimatedCost = 89
    doc.Region = "Pacific Rim"
    Call doc.Save( False, True )
  3. This script creates a new text item called Contacts in a document, and adds three new values to it.
    Dim doc As NotesDocument
    '...set value of doc...
    Dim stringArray ( 1 To 3 ) As String
    stringArray( 1 ) = "Chrissa Ehrhardt"
    stringArray( 2 ) = "Allegra Pisarro"
    stringArray( 3 ) = "Esteban Garcia"
    Call doc.AppendItemValue( "Contacts", stringArray )
    Call doc.Save( False, True )
  4. This script achieves the same result using the extended class syntax. The difference is that if an item called Contacts already exists in the document, its value is replaced with the values Chrissa Ehrhardt, Allegra Pisarro, and Esteban Garcia.
    Dim stringArray ( 1 To 3 ) As String
    stringArray ( 1 ) = "Chrissa Ehrhardt"
    stringArray ( 2 ) = "Allegra Pisarro"
    stringArray ( 3 ) = "Esteban Garcia"
    doc.Contacts = stringArray
    Call doc.Save( False, True )
  5. This script creates a new time-date item called DueDate in a document. It has the value 08/15/95 12:00:00 AM.
    Dim doc As NotesDocument
    '...set value of doc...
    Call doc.AppendItemValue("DueDate",  _
    Datenumber(1995, 8, 15))
    Call doc.Save( False, True )
  6. This script achieves the same result using the extended class syntax. If an item with the name DueDate already exists on the document, its value is replaced with 08/15/95 12:00:00 AM.
    doc.DateDue = Datenumber( 1995, 8, 15 )
    Call doc.Save( False, True )