Examples: CopyItemToDocument method

This script copies the Body and BriefDescription items from a document to a new mail memo in the current database. The Body item keeps its name; the BriefDescription item is renamed Subject.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim memo As NotesDocument
Dim itemA As NotesItem
Dim itemB As NotesItem
Set db = session.CurrentDatabase
'...set value of doc...
Set itemA = doc.GetFirstItem( "Body" )
Set itemB = doc.GetFirstItem( "BriefDescription" )
Set memo = New NotesDocument( db )
Call itemA.CopyItemToDocument( memo, "Body" )
Call itemB.CopyItemToDocument( memo, "Subject" )
Call memo.Send( False, "Cynthia Brainey" )