Lotus Software logo
IBM Lotus Domino Designer 8.5
  Versions 8.5 and 8.5.1






Examples: GetFirstItem method

  1. This script prints a message about the Subject item in a document.
  2. Dim doc As NotesDocument
    
    '...set value of doc...
    Dim item As NotesItem
    Set item = doc.GetFirstItem( "Subject" )
    If ( item Is Nothing ) Then
    Messagebox( "No Subject item on the document." )
    Else
    Messagebox( _
    "The Subject item on the document has the value: " _
    + item.Text )
    End If
  3. This example demonstrates an attempt to get the value of the DateComposed item in a document. If there is no such item (possibly because DateComposed is only a field that's computed for display), it uses the Created property instead.
  4. Dim doc As NotesDocument
    
    Dim item As NotesItem
    Dim dateTime As New NotesDateTime( "" )
    '...set value of doc...
    Set item = doc.GetFirstItem( "DateComposed" )
    ' An item called DateComposed doesn't exist on the document
    If ( item Is Nothing ) Then
    dateTime.LSLocalTime = doc.Created
    ' an item called DateComposed exists
    ' on the document
    Else
    Set dateTime = item.DateTimeValue
    End If
  5. This script gets a rich text item from a document and adds some text to it.
  6. Dim doc As NotesDocument
    
    Dim rtitem As NotesRichTextItem
    '...set value of doc...
    Set rtitem = doc.GetFirstItem( "Body" )
    If ( rtitem.Type = RICHTEXT ) Then
    Call rtitem.AppendText( "One line of text" )
    Call rtitem.AddNewLine( 2 )
    Call rtitem.AppendText( "Another line of text" )
    Call doc.Save( False, True )
    End If
Related topics
GetFirstItem method




Library | Support | Terms of use |

Last updated: Monday, October 5, 2009