Dim doc As NotesDocument
Dim rtitem As Variant
'...set value of doc...
Set rtitem = doc.GetFirstItem( "ProjectDescription" )
If ( rtitem.Type = RICHTEXT ) Then
Call rtitem.AppendText( "Before" )
Call rtitem.AddTab( 2 )
Call rtitem.AppendText( "After" )
Call doc.Save( False, True )
End If
If the ProjectDescription item is empty when the script begins, it looks like this when the script finishes:
Before After
Dim targetDoc As NotesDocument
Dim targetRTItem As NotesRichTextItem
'...set value of targetDoc...
Set targetRTItem = New NotesRichTextItem _
( targetDoc, "ProductListing" )
Dim sourceDb As NotesDatabase
Dim sourceView As NotesView
Dim sourceDoc As NotesDocument
Set sourceDb = New NotesDatabase( "Belem", "inventry.nsf" )
Set sourceView = sourceDb.GetView( "Products" )
Set sourceDoc = sourceView.GetFirstDocument
While Not ( sourceDoc Is Nothing )
a = sourceDoc.ColumnValues( 0 )
b = sourceDoc.ColumnValues( 1 )
Call targetRTItem.AppendText( a )
Call targetRTItem.AddTab( 1 )
Call targetRTItem.AppendText( Str( b ) )
Call targetRTItem.AddNewLine( 1 )
Set sourceDoc = sourceView.GetNextDocument( sourceDoc )
Wend
Call targetDoc.Save( False, True )
For example, if the Products view in INVENTORY.NSF has product names in the first column and quantities in the second, the result in the ProductListing item might look like this:
Nails, common #08 989
Nails, common #10 1000
Nails, common #12 1000
Nails, common #16 978
Screws, slot, 1/4x2 1000